Fix approval/user-input events using orchestration ID instead of provider thread ID#1150
Closed
cursor[bot] wants to merge 1 commit intocodething/648ca884-claudefrom
Closed
Fix approval/user-input events using orchestration ID instead of provider thread ID#1150cursor[bot] wants to merge 1 commit intocodething/648ca884-claudefrom
cursor[bot] wants to merge 1 commit intocodething/648ca884-claudefrom
Conversation
…ider thread ID Replace direct use of context.session.threadId with providerThreadRef(context) in four locations within approval and user-input handlers, consistent with all other event emissions in the file. Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.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.
What Changed
In
ClaudeAdapter.ts, four event emissions in the approval and user-input handlers (handleAskUserQuestionrequest/resolved andcanUseToolrequest/resolved) were usingcontext.session.threadIdasproviderThreadIddirectly, instead of callingproviderThreadRef(context)which correctly mapscontext.resumeSessionId. Replaced all four occurrences with the helper function call.Why
context.session.threadIdis the orchestration-level thread ID, not the Claude SDK's native session ID. Every other event emission in the file correctly usesproviderThreadRef(context), which returnscontext.resumeSessionId. This inconsistency meant approval and user-input runtime events carried an incorrect provider thread reference, breaking observability and any downstream logic correlating events by provider thread ID.Checklist
Note
Fix approval and user-input events to use provider thread ID instead of orchestration ID
In ClaudeAdapter.ts, the
providerRefsfield in emitted runtime events (user-input.requested,user-input.resolved, andcanUseToolrequest/decision events) was using an inline conditionalproviderThreadIdfield. These sites now useproviderThreadRef(context)to ensure the correct provider thread ID is referenced consistently.Macroscope summarized 241180f.