fix(daemon): final-message root output, normalized chat-span parts - #135
Draft
rgao-coreweave wants to merge 1 commit into
Draft
fix(daemon): final-message root output, normalized chat-span parts#135rgao-coreweave wants to merge 1 commit into
rgao-coreweave wants to merge 1 commit into
Conversation
The root invoke_agent span re-dumped every text block of the turn as gen_ai.output.messages, and chat spans passed raw Anthropic content blocks as parts. Both collapsed the Weave Agents chat view into one trailing message. Root output is now the final assistant message only (interstitial text renders as ordered assistant_text child spans), and chat-span parts are normalized to the GenAI shape the chat view expects, matching the Codex plugin. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
invoke_agentturn span now carries only the final assistant message ongen_ai.output.messages. Interstitial text already renders as orderedassistant_textchild spans, and re-dumping every text block on the root is what collapsed the Agents chat view into one trailing message.text/thinkingbecome{type, content},tool_usebecomes{type: 'tool_call', toolCallId, toolName, arguments}) instead of raw Anthropic blocks, matching the Codex plugin. Covers both the main-agent path (emitChatSpanForResponse) and the subagent/teammate path (emitChatSpansFromAssistantCalls); deletes the now-deadassistantBlocksToText.tool_callparts duplicate the siblingexecute_toolspans (Codex does the same). If the chat view keys off tool spans instead, we can drop tool entries from parts.Test plan
tests/output-messages-contract.test.ts: root output with and withoutlast_assistant_message, normalized parts on both chat-span paths, and aredacted_thinking-only response emitting nogen_ai.output.messages.npm run checkgreen (build + 90 tests).🤖 Generated with Claude Code