You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The agenticruntime stream sends a toolCall entity when a tool starts and when it completes, with the parameters the model filled in, the result and the duration. The /chat summary only kept the activity text (Calling X..., X completed). This adds a tool_calls array to the default JSON output and lists the calls in --pretty.
scripts/src/response-format.js: collectToolCalls merges the entities into one record per toolCallId: { id, name, category, status, filledParameters, unfilledParameters, durationMs, result, error }.
A repeated started entity can't undo a later status or overwrite anything set after it.
An error is dropped when the call moves to a new status without one.
An empty filledParameters object doesn't overwrite real values.
Results over 2000 characters are cut, with resultTruncated and resultLength.
error/errorMessage is kept if the runtime sends one.
Entities without a toolCallId each get their own record, with an anon:<name>#<n> id.
scripts/src/chat-with-agent.js: tool_calls in the default JSON output.
scripts/src/terminal-render.js: --pretty lists each call with status, duration and inputs (inputs capped at 300 characters); nameless calls fall back to the id.
commands/chat.md: documents the field, including that a failed flow can still show up as completed with an empty result.
scripts/test/response-format.test.js: 21 tests for the merge logic.
The first commit only rebuilds chat-with-agent.bundle.js with esbuild 0.28.1 (pinned since #27; the committed bundle was built with 0.24.2), so the feature commit's bundle diff is just the new code. Both bundles are byte-identical to a fresh npm run build:chat-with-agent.
Testing
npm test in scripts/: 71 passing.
Ran the rebuilt bundle against a published CLI agent with a flow tool, in default and --pretty mode. tool_calls had the right name, status, filled parameters, duration and result.
No source change. The committed bundle was built with esbuild 0.24.2,
while package.json pins 0.28.1 since microsoft#27, so any rebuild produces this
diff. Keeping it separate makes the next change reviewable.
The agenticruntime stream sends a toolCall entity when a tool starts and
when it completes, with the parameters the model filled in, the result
and the duration. The summary only kept the activity text.
collectToolCalls merges those entities into one record per toolCallId,
keeping the runtime's field names. A repeated "started" entity can't undo
"completed", empty parameter objects don't overwrite real ones, results
over 2000 characters are truncated with their full length recorded, and
an error field is kept if the runtime sends one. The default JSON output
includes tool_calls and --pretty lists the calls with their inputs.
Fixesmicrosoft#43
Anonymous toolCall entities used a fallback id as the map key, which
could collide with a real toolCallId of the same shape. They now use
their own key space. An empty error field no longer hides a non-empty
errorMessage.
Clear stale truncation metadata when replacing with a short result
scripts/src/response-format.js:115
If the same call emits a long result and a later entity updates it with a result at or below 2000 characters, this branch replaces result but leaves the previous resultTruncated and resultLength fields. The summary then claims the current result is truncated and reports the old length; clear those fields when storing a non-truncated result.
…ities
- A later short result clears resultTruncated/resultLength.
- A repeated "started" entity after a later status no longer overwrites
parameters, duration or anything else; it can only fill gaps.
- An error is dropped when the call moves to a new status without one.
- --pretty falls back to the id for nameless calls and skips empty meta.
- chat.md documents the anon: id and the {} result of a failed flow.
Addressed the "previously missed" note from the last automated review in d43970d: a later short result now clears resultTruncated/resultLength. The same commit also stops a repeated started entity from overwriting parameters set by a later status, and drops an error when the call moves to a new status without one. Tests cover each case (71 passing).
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🔵 Needs a closer look
Fix stale-error handling in tool-call merging and regenerate the committed bundle.
Review effort: Lite Findings: None
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
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
The agenticruntime stream sends a
toolCallentity when a tool starts and when it completes, with the parameters the model filled in, the result and the duration. The/chatsummary only kept the activity text (Calling X...,X completed). This adds atool_callsarray to the default JSON output and lists the calls in--pretty.Fixes #43.
Changes
scripts/src/response-format.js:collectToolCallsmerges the entities into one record pertoolCallId:{ id, name, category, status, filledParameters, unfilledParameters, durationMs, result, error }.startedentity can't undo a later status or overwrite anything set after it.filledParametersobject doesn't overwrite real values.resultTruncatedandresultLength.error/errorMessageis kept if the runtime sends one.toolCallIdeach get their own record, with ananon:<name>#<n>id.scripts/src/chat-with-agent.js:tool_callsin the default JSON output.scripts/src/terminal-render.js:--prettylists each call with status, duration and inputs (inputs capped at 300 characters); nameless calls fall back to the id.commands/chat.md: documents the field, including that a failed flow can still show up ascompletedwith an empty result.scripts/test/response-format.test.js: 21 tests for the merge logic.The first commit only rebuilds
chat-with-agent.bundle.jswith esbuild 0.28.1 (pinned since #27; the committed bundle was built with 0.24.2), so the feature commit's bundle diff is just the new code. Both bundles are byte-identical to a freshnpm run build:chat-with-agent.Testing
npm testinscripts/: 71 passing.--prettymode.tool_callshad the right name, status, filled parameters, duration and result.