fix(agui): emit frontend tool args from fragment deltas - #2874
Conversation
…i#2873) Streaming tool-call chunks use a placeholder name, so frontend-tool matching must use the real name recorded on ToolCallStart.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
CI失败与本次提交无关 |
Aias00
left a comment
There was a problem hiding this comment.
Matches #2873 exactly: the real tool name is captured on ToolCallStart and the frontend-tool decision is made from toolCallId instead of the __fragment__ placeholder, so frontend tools keep receiving TOOL_CALL_ARGS while backend tools stay hidden under emitToolCallArgs=false.
Deliberate details I checked and like:
- The raw (pre-normalisation) name is stored, so matching is against what the client actually declared in
RunAgentInput.tools. Collectors.toSet()rather thantoUnmodifiableSet()— the latter would NPE on a nullAguiTool.name.isFrontendToolCalldegrades tofalsewhen the start event was never seen, so the previous opt-in behaviour is preserved.
Tests cover both directions (frontend emits, backend does not) with the exact placeholder-name stream from the issue.
Note on CI: the build (windows-latest) failure is unrelated — it is SessionEventLogCrossProcessTest.subscribeAfterCursorSkipsEarlierEvents in service-common failing with a Reactor OverflowException from interval backpressure, a known Windows timing flake.
One non-blocking nit inline about pruning the new map. Approving.
Related issues
Summary
ToolCallStartand match frontend tools bytoolCallId.TOOL_CALL_ARGSfor frontend tools even when streamed deltas use__fragment__.emitToolCallArgsis false.Breaking Changes
None.