Repository navigation
chat: add per-run reasoning timing metadata - #552
Merged
Merged
Conversation
Carry producer-recorded reasoning start times and durations through protocol state, timing-only actions, and all client reducers. Preserve unknown timing and recorded zeroes across snapshots and completed turns. Co-authored-by: Copilot <[email protected]>
Define thinking runs independently of SDK block and message boundaries. Preserve their identities and individual durations around markdown and tool output, with shared 5s/12s conformance coverage. Co-authored-by: Copilot <[email protected]>
Justin Chen (justschen)
added a commit
to microsoft/vscode
that referenced
this pull request
Oct 30, 2026
Keep one reasoning identity and clock until markdown, a new tool call, or turn termination. Persist the observed response-part ordering and update runs that span SDK messages, rather than storing message-level totals. Restore separate run durations and canonical tool positions, retain conversation grouping with per-run labels, and cover 5s/12s boundaries across database restart and UI reload. Pin the clarified contract from microsoft/agent-host-protocol#552. Co-authored-by: Copilot <[email protected]>
Connor Peet (connor4312)
approved these changes
Oct 30, 2026
This comment was marked as spam.
This comment was marked as spam.
Justin Chen (justschen)
marked this pull request as ready for review
October 30, 2026 17:31
Justin Chen (justschen)
added a commit
to microsoft/vscode
that referenced
this pull request
Oct 30, 2026
Reference the merge commit of microsoft/agent-host-protocol#552. The generated protocol sources are unchanged. Co-authored-by: Copilot <[email protected]>
Justin Chen (justschen)
added a commit
to microsoft/vscode
that referenced
this pull request
Oct 30, 2026
* chat: persist agent-host reasoning timing Preserve producer-owned timing across live updates, reconnection, and saved chat history so fallback thinking headers retain their elapsed time. Record Copilot reasoning against durable assistant-message IDs without timing replay or inventing missing historical durations. Sync the optional protocol fields from microsoft/agent-host-protocol commit f9d401d7. Co-authored-by: Copilot <[email protected]> * chat: preserve timing for each contiguous thinking run Keep one reasoning identity and clock until markdown, a new tool call, or turn termination. Persist the observed response-part ordering and update runs that span SDK messages, rather than storing message-level totals. Restore separate run durations and canonical tool positions, retain conversation grouping with per-run labels, and cover 5s/12s boundaries across database restart and UI reload. Pin the clarified contract from microsoft/agent-host-protocol#552. Co-authored-by: Copilot <[email protected]> * chat: fix imported and late reasoning timing Persist imported response projections against synthesized Copilot event IDs before resume. Refresh timing labels on finalized reasoning sections, including array and grouped content, and keep AHP timing provider-owned even when optional timing fields are absent. Add import/reopen, late visible/ARIA label, and untimed reconnect regressions while preserving local-provider measurement. Co-authored-by: Copilot <[email protected]> * agentHost: pin merged reasoning timing protocol Reference the merge commit of microsoft/agent-host-protocol#552. The generated protocol sources are unchanged. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
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
Add optional producer-recorded timing for each contiguous reasoning run, so clients can retain labels such as "Thought for 5s" across subscriptions, reconnects, and restored history instead of timing replay or combining unrelated runs.
This represents two reasoning parts with durations
5000and12000, not a message/group total of17000. The interval starts at the first nonempty reasoning text and ends at the next markdown/tool part or turn termination. SDK block IDs, message completion, and sideband metadata do not split a run.startedAt(ISO 8601) andduration(non-negative integer milliseconds) toReasoningResponsePartandChatReasoningAction.content; omitted fields preserve existing values, including recorded zero.Companion implementation: microsoft/vscode#345121. It records Copilot runs, preserves their ordering across SDK messages, and displays their separate durations after reload without removing conversation grouping.
Compatibility
The wire fields are optional and require no protocol-version bump. Hosts publish final timing before the turn's terminal action and retain individual runs when restoring history. Missing timing remains unknown; clients must not infer it from their own clock or invent values for older/interrupted history.
Native client consumers should rebuild against the updated generated models. Rust struct literals need the new optional fields (normally
Nonewhen unknown); Kotlin callers using positional constructor arguments should use named arguments when upgrading. This is wire-compatible, not a promise of native binary compatibility.Validation
npm run generatenpm testclients/typescriptnpm run typecheckclients/typescriptnpm testclients/gogo test -count=1 ./...clients/rustcargo test --workspace -j 2clients/swift/AgentHostProtocolswift test -j 2clients/kotlin./gradlew test --no-daemon --console=plain --max-workers=2clients/dotnetdotnet build --configuration Release --disable-build-servers -maxcpucount:2Validation includes the shared 5s/12s run-separation fixture. Kotlin/.NET execution remains for CI.