Skip to content

[Bug]: History Length = 0, is returning all the history #573

Closed

Description

@anandsugumaran

What happened?

As per the spec defined in website, historyLength=0 should not return any history. But we are getting all the history.

https://a2a-protocol.org/latest/specification/#323-stream-response

Image

Relevant log output

curl -s -X POST "http://localhost:9000/" -H "Content-Type: application/json" -d '{
    "jsonrpc": "2.0",
    "method": "message/send",
    "params": {
        "message": {
            "messageId": "your-unique-message-id",
            "role": "user",
            "parts": [
                {"text": "What is 2+3 ?"}
            ]
        },
        "configuration": {
            "acceptedOutputModes": ["text/plain"],
			"historyLength":1
		}
    }'

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "artifacts": [
            {
                "artifactId": "a67dace3-cd78-413e-badc-e0cf94507d18",
                "name": "agent_response",
                "parts": [
                    {
                        "kind": "text",
                        "text": "### Simple Math\n\n2 + 3 = **5**\n\nIf you have any questions about your finances, spending habits, budgeting, or would like to explore your account, I'm here to help!\n"
                    }
                ]
            }
        ],
        "contextId": "51ee491d-28b8-4c32-9b2f-f7426b33f7ee",
        "history": [
            {
                "contextId": "51ee491d-28b8-4c32-9b2f-f7426b33f7ee",
                "kind": "message",
                "messageId": "your-unique-message-id",
                "parts": [
                    {
                        "kind": "text",
                        "text": "What is 2+3 ?"
                    }
                ],
                "role": "user",
                "taskId": "07f2a3b2-f498-438f-87b4-69fe60784e36"
            },
            {
                "contextId": "51ee491d-28b8-4c32-9b2f-f7426b33f7ee",
                "kind": "message",
                "messageId": "379b0031-cf8f-4354-93ea-f28a25e88f3c",
                "parts": [
                    {
                        "kind": "text",
                        "text": "###"
                    }
                ],
                "role": "agent",
                "taskId": "07f2a3b2-f498-438f-87b4-69fe60784e36"
            },
            {
                "contextId": "51ee491d-28b8-4c32-9b2f-f7426b33f7ee",
                "kind": "message",
                "messageId": "5ca7940e-36a1-4bea-bf02-3d2bdd1ca424",
                "parts": [
                    {
                        "kind": "text",
                        "text": " Simple Math\n\n2 + 3"
                    }
                ],
                "role": "agent",
                "taskId": "07f2a3b2-f498-438f-87b4-69fe60784e36"
            },
            {
                "contextId": "51ee491d-28b8-4c32-9b2f-f7426b33f7ee",
                "kind": "message",
                "messageId": "9d6739a1-95e5-4dc2-93c2-71a4f77fefc8",
                "parts": [
                    {
                        "kind": "text",
                        "text": " = **5**\n\nIf"
                    }
                ],
                "role": "agent",
                "taskId": "07f2a3b2-f498-438f-87b4-69fe60784e36"
            },
            {
                "contextId": "51ee491d-28b8-4c32-9b2f-f7426b33f7ee",
                "kind": "message",
                "messageId": "7865ceab-3c21-4f2c-bf56-7f3ed8054156",
                "parts": [
                    {
                        "kind": "text",
                        "text": " you have"
                    }
                ],
                "role": "agent",
                "taskId": "07f2a3b2-f498-438f-87b4-69fe60784e36"
            },
            {
                "contextId": "51ee491d-28b8-4c32-9b2f-f7426b33f7ee",
                "kind": "message",
                "messageId": "07e69ddb-c745-4ad7-8550-d7f6f4f2676e",
                "parts": [
                    {
                        "kind": "text",
                        "text": " any questions about your finances,"
                    }
                ],
                "role": "agent",
                "taskId": "07f2a3b2-f498-438f-87b4-69fe60784e36"
            },
            {
                "contextId": "51ee491d-28b8-4c32-9b2f-f7426b33f7ee",
                "kind": "message",
                "messageId": "e8e474b0-2c7d-4d73-a397-aa93f915c9ad",
                "parts": [
                    {
                        "kind": "text",
                        "text": " spending"
                    }
                ],
                "role": "agent",
                "taskId": "07f2a3b2-f498-438f-87b4-69fe60784e36"
            },
            {
                "contextId": "51ee491d-28b8-4c32-9b2f-f7426b33f7ee",
                "kind": "message",
                "messageId": "4ac5f332-5512-4b14-8e78-4bfaa29e2d5b",
                "parts": [
                    {
                        "kind": "text",
                        "text": " habits"
                    }
                ],
                "role": "agent",
                "taskId": "07f2a3b2-f498-438f-87b4-69fe60784e36"
            },
            {
                "contextId": "51ee491d-28b8-4c32-9b2f-f7426b33f7ee",
                "kind": "message",
                "messageId": "fcefe6a4-a50a-4b05-9dfd-8b65af250961",
                "parts": [
                    {
                        "kind": "text",
                        "text": ", bu"
                    }
                ],
                "role": "agent",
                "taskId": "07f2a3b2-f498-438f-87b4-69fe60784e36"
            },
            {
                "contextId": "51ee491d-28b8-4c32-9b2f-f7426b33f7ee",
                "kind": "message",
                "messageId": "55a6d3e0-9e10-49b9-91bb-480a56e319c4",
                "parts": [
                    {
                        "kind": "text",
                        "text": "dgeting, or woul"
                    }
                ],
                "role": "agent",
                "taskId": "07f2a3b2-f498-438f-87b4-69fe60784e36"
            },
            {
                "contextId": "51ee491d-28b8-4c32-9b2f-f7426b33f7ee",
                "kind": "message",
                "messageId": "49259de3-c2f9-4f5c-80d1-275fd3143d63",
                "parts": [
                    {
                        "kind": "text",
                        "text": "d like to explore"
                    }
                ],
                "role": "agent",
                "taskId": "07f2a3b2-f498-438f-87b4-69fe60784e36"
            },
            {
                "contextId": "51ee491d-28b8-4c32-9b2f-f7426b33f7ee",
                "kind": "message",
                "messageId": "258f271e-5833-481c-a269-3f17a54c426b",
                "parts": [
                    {
                        "kind": "text",
                        "text": " your"
                    }
                ],
                "role": "agent",
                "taskId": "07f2a3b2-f498-438f-87b4-69fe60784e36"
            },
            {
                "contextId": "51ee491d-28b8-4c32-9b2f-f7426b33f7ee",
                "kind": "message",
                "messageId": "ee6eff49-0c9b-4165-8473-a3379c3ae6ee",
                "parts": [
                    {
                        "kind": "text",
                        "text": " account, I'm here to"
                    }
                ],
                "role": "agent",
                "taskId": "07f2a3b2-f498-438f-87b4-69fe60784e36"
            },
            {
                "contextId": "51ee491d-28b8-4c32-9b2f-f7426b33f7ee",
                "kind": "message",
                "messageId": "83b174b4-b2ec-4e5a-ad0b-46e9b796c3c4",
                "parts": [
                    {
                        "kind": "text",
                        "text": " help!"
                    }
                ],
                "role": "agent",
                "taskId": "07f2a3b2-f498-438f-87b4-69fe60784e36"
            }
        ],
        "id": "07f2a3b2-f498-438f-87b4-6"
    }
}

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. self-assigned this
    on Dec 1, 2025
  2. lkawka commented on Dec 1, 2025

    @lkawka
    Member

    Hi Anand,

    You're right, the SDK should behave differently.

    The root cause is that the specification was recently updated, and our current implementation has not yet integrated these changes. Specifically, there is an issue with differentiating between unset values and explicit 0 values in the current SDK version.

    The latest specification addresses this by making the history_length field optional. We’re currently planning how to deal with the recent specification changes in the SDK and will then address this issue.

  3. anandsugumaran commented on Dec 2, 2025

    @anandsugumaran
    Author

    Hi @lkawka

    Thanks for confirming. Will wait for this change in upcoming releases.

  4. added 3 commits that reference this issue on Feb 20, 2026
    99d41da
    6085fa0
    72a1007
  5. ishymko commented on Feb 23, 2026

    @ishymko
    Member

    This was fixed for 1.0 release via #717.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions