Claude agent: assistant text after a tool call must be emitted (turn shape "text → tool call → final text")
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 4.6k
- Forks
- 251
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 34
Description
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_eventpartials and full assistant messages. - If the same defect exists in the current adapter, please fix it.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the packaged Claude agent's handling of stream_event partials, full assistant messages, and tool_use events. Reproduce the assistant text → tool call → final text turn, then add a regression test showing that the final text is emitted as agent_message_chunk and verify the current adapter behavior.
Written by the indexing model from the issue text.
Assessment
- Domain
- ai
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100