Skip to content

Claude agent: assistant text after a tool call must be emitted (turn shape "text → tool call → final text") #1836

Description

@atsushi-ishibashi

Problem

With the 0.1.x adapter (@rivet-dev/agent-os-claude), a turn shaped "assistant text → tool call → final assistant text" lost the final text: it was never emitted as agent_message_chunk, so the client only saw the tool call finish with no answer. This is a common shape for MCP tool usage. Root cause there: a sawAssistantText duplicate-suppression flag was set by the pre-tool text and never reset on tool_use, so all subsequent assistant text in the turn was dropped as a duplicate.

Request

  • Confirm the packaged Claude agent on current main streams the final text for this turn shape.
  • Add a regression test for it — the bug is easy to reintroduce with any duplicate-suppression logic between stream_event partials and full assistant messages.
  • If the same defect exists in the current adapter, please fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions