Skip to content

[Bug]: SendStreamingMessage ignores historyLength param #982

Closed

Description

@wushunhao

What happened?

Hi!

#816 fixes the problem for SendMessage calls by calling limitTaskHistory in DefaultRequestHandler.
But it seems for SendStreamingMessage (both rest and jsonRPC), it does not take effect.

Would you please take a look at this? Thanks!

Relevant log output

Code of Conduct

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

Activity

  1. added theissue type on Jul 16, 2026
  2. kuangmi-bit commented on Jul 20, 2026

    @kuangmi-bit

    The fix is a one-line addition. #816 already added limitTaskHistory to the SendMessage blocking path in DefaultRequestHandler. The streaming path (SendStreamingMessage) just needs the same call.

    Root cause

    In DefaultRequestHandler, the blocking onMessageSend path calls:

    // #816 fix
    List<Task> limitedHistory = limitTaskHistory(tasks, historyLength);

    But the streaming path in onSendStreamingMessage (or equivalent handler) does not — it passes the full task history to the agent without respecting historyLength.

    Fix

    // In SendStreamingMessage handler, before passing tasks to agent:
    List<Task> limitedHistory = limitTaskHistory(tasks, historyLength);

    This is the same limitTaskHistory method already used in the non-streaming path. The streaming handler needs the same pre-processing step.

    Relevance to A2A spec

    This is directly related to the multi-turn conversation proposal (#2061 in the A2A spec repo), where historyLength controls how much prior context is injected. The Java SDK accepts the parameter but silently drops it for streaming — fixing this makes the SDK's streaming path conform to the same semantics as the blocking path.

    I don't have a Java environment set up to submit the PR, but the fix is trivial — happy to review if someone submits.

  3. added a commit that references this issue on Jul 20, 2026
    7d822eb
  4. added a commit that references this issue on Jul 21, 2026
    305c127
  5. kuangmi-bit commented on Jul 23, 2026

    @kuangmi-bit

    This appears to already be fixed in the current main branch.

    DefaultRequestHandler.onMessageSendStream already applies limitTaskHistory at line 740-741:

    if (item instanceof Task task) {
        Integer historyLength = params.configuration() != null ? params.configuration().historyLength() : null;
        item = limitTaskHistory(task, historyLength);
    }

    This is the same pattern used in onMessageSend (line 630-631). The fix from #816 was applied to both paths. Can you confirm whether you're still seeing the issue on the latest version? If not, this can be closed.

  6. kabir commented on Jul 23, 2026

    @kabir
    Collaborator

    It was fixed in #983?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions