Repository navigation
fix(core): stop HITL continuations reusing the originating run id on the wire - #6411
Merged
Merged
Conversation
…the wire #6296 preserved the logical run id across a HITL resolve by pinning the originating id on the follow-up's agent invocation. That fixed #3456 (external tracing saw one logical run split into two halves), but pinning it on the WIRE made the transport treat the follow-up as a resumption of a run it had already finished. It re-delivered that run's already-applied half — duplicating every tool call on the message, each duplicate carrying empty arguments, since a start event has none and the TOOL_CALL_ARGS deltas that follow are addressed to the first copy — and the follow-up's own tool call never reached client state, so its card never rendered. In the reskinnable-demo banking skin that broke teach mode outright: the agent called awaitDashboardDemonstration, the server emitted TOOL_CALL_START for it, and the live "Recording your workflow" card never appeared, leaving no way to finish or save the demonstration. #6296's goal is kept, moved one layer up. The continuation is registered against the originating id (markNextRunAsContinuation already took an expectedRunId parameter, previously unused) and the state manager re-stamps the continuation's events onto it. State/message association and external tracing still see ONE logical run; the wire is simply allowed to identify the invocation honestly. Nothing from #6296 is reverted. core-follow-up's run-id test asserted the mechanism (both invocations carry the same wire id), which this deliberately changes, so it now asserts the goal: the originating id is pinned on the first invocation and the follow-up leaves it to the transport. Its sibling assertion — the thread still knows exactly one run — was already there and still passes untouched. A new StateManager test covers the re-stamp directly; verified red before green by dropping the expectedRunId lookup. Verified in the browser against a live Intelligence stack: before, the recording card never rendered; after, it renders with its REC indicator and I'm done / Cancel controls. `@copilotkit/core` 58 files and `@copilotkit/react-core` 123 files pass. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
davidmckayv
requested review from
jpr5,
marthakelly,
mme,
ranst91 and
tylerslaton
as code owners
August 5, 2026 23:13
@copilotkit/a2ui-renderer
@copilotkit/agentcore-runner
@copilotkit/angular
@copilotkit/channels
@copilotkit/channels-core
@copilotkit/channels-discord
@copilotkit/channels-intelligence
@copilotkit/channels-slack
@copilotkit/channels-teams
@copilotkit/channels-telegram
@copilotkit/channels-ui
@copilotkit/channels-whatsapp
@copilotkit/core
@copilotkit/react-core
@copilotkit/react-native
@copilotkit/react-textarea
@copilotkit/react-ui
@copilotkit/runtime
@copilotkit/runtime-client-gql
@copilotkit/sdk-js
@copilotkit/shared
@copilotkit/sqlite-runner
@copilotkit/voice
@copilotkit/vue
@copilotkit/web-components
@copilotkit/web-inspector
commit: |
Contributor
|
Size Change: +151 B (+0.01%) Total Size: 1.22 MB 📦 View Changed
ℹ️ View Unchanged
|
The sibling of the core-follow-up assertion, missed in the previous commit: it required the follow-up invocation to repeat the originating run id on the wire, which is exactly what this change stops doing. It now asserts the follow-up happened and left the id to the transport. Logical identity is covered where it now lives — StateManager's re-stamp test. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
tylerslaton
approved these changes
Aug 5, 2026
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.
Linear: CPK-7786
Regression fix. Nothing from #6296 is reverted — its goal is kept and moved one layer up.
What broke
#6296 (@rodboev) preserved the logical run id across a HITL resolve by pinning the originating id on the follow-up's agent invocation, correctly fixing #3456 (external tracing saw one logical run split into two halves).
Pinning it on the wire, though, made the transport treat the follow-up as a resumption of a run it had already finished:
TOOL_CALL_ARGSdeltas that follow are addressed to the first copy; andIn
reskinnable-demo's banking skin that killed teach mode: the agent calledawaitDashboardDemonstration, the server emittedTOOL_CALL_STARTfor it, and the live "Recording your workflow" card never appeared — no REC indicator, no step feed, no "I'm done", so a demonstration could not be finished or saved.Evidence
RUN_STARTED/RUN_FINISHEDcycles under one run id, withTOOL_CALL_START [awaitDashboardDemonstration]in the second — the server does emit it.useRenderToolCall: never invoked for that tool, despite its renderer being registered.assistant tc:["recall_memory","recall_memory"],assistant tc:["offerWorkflowRecording","offerWorkflowRecording"]— prior cycle re-applied, new call absent.The fix
markNextRunAsContinuationalready accepted anexpectedRunIdthat was never used. It now records it, and the state manager re-stamps the continuation's events onto that id. So:Test changes — please review this part closely
core-follow-up's run-id test asserted the mechanism (both invocations carry the same wire id), which this deliberately changes. It now asserts the goal: the originating id is pinned on the first invocation, and the follow-up leaves the id to the transport. Its sibling assertion — the thread still knows exactly one run — was already there and passes untouched.A new
StateManagertest covers the re-stamp directly, verified red before green by dropping theexpectedRunIdlookup (it fails, along with one of #6296's own tests).@rodboev — flagging you directly since this touches your change from today. If the wire-level pinning was load-bearing for something I have not seen, say so and I will rework it.
Verification
@copilotkit/core58 files and@copilotkit/react-core123 files pass.🤖 Generated with Claude Code