fix(server): Claude steers wait for the tool boundary instead of cancelling tools #36945
ClosedAlb11747(GitHub profile, opens in a new tab)wants to merge 5 commits into
main fromrefs/pull/36945/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
Alb11747(GitHub profile, opens in a new tab) linked this to fix #21895
- @@ -11602,5 +11626,21 @@11626+ message.subtype === "success" &&11627+ !message.is_error11628+ ) {1160211629 context.steeredSegmentUsage.push(message.usage);1160311630 context.steeredLedgerUsage = addClaudeLedgerUsage(1160411631 context.steeredLedgerUsage,1160511632 resultLedgerUsage.get(message),1160611633 );11634+ // Published now, a reply only this result carried leaves the fallback to the steer's reply.11635+ if (context.assistant.fallbackText.length > 0) {11636+ yield* publishAssistantArtifacts({11637+ context,11638+ nativeItemId: context.assistant.fallbackNativeItemId,11639+ text: context.assistant.fallbackText,11640+ status: "completed",11641+ startedAt: context.startedAt,11642+ completedAt,11643+ });11644+ context.assistant.fallbackText = "";11645+ }11646+ yield* sendHeldSteers(context);
juliusmarminge added labelstakeover:in-progress
- @@ -11589,13 +11620,8 @@11589- const cutOffReply = context.assistant.lastReply;11590- context.assistant.lastReply = null;11591- if (message.terminal_reason === "aborted_streaming") {11592- yield* cutOffStreamedText(context);11593- }11594- if (message.terminal_reason === "aborted_streaming" && cutOffReply !== null) {11595- yield* publishAssistantArtifacts({11596- context,11597- ...cutOffReply,11598- status: "interrupted",11599- completedAt,11600- });11601- }11620+ // Claude ended the turn before a tool boundary took the held steers, so11621+ // it runs them next, still as part of this turn.11622+ if (11623+ !interrupted &&11624+ !liveQuery.stopping &&11625+ context.heldSteers.length > 0 &&11626+ message.subtype === "success" &&11627+ !message.is_error@@ -11602,5 +11626,21 @@11626+ message.subtype === "success" &&11627+ !message.is_error11628+ ) {1160211629 context.steeredSegmentUsage.push(message.usage);1160311630 context.steeredLedgerUsage = addClaudeLedgerUsage(1160411631 context.steeredLedgerUsage,1160511632 resultLedgerUsage.get(message),1160611633 );11634+ // Published now, a reply only this result carried leaves the fallback to the steer's reply.11635+ if (context.assistant.fallbackText.length > 0) {11636+ yield* publishAssistantArtifacts({11637+ context,11638+ nativeItemId: context.assistant.fallbackNativeItemId,11639+ text: context.assistant.fallbackText,11640+ status: "completed",11641+ startedAt: context.startedAt,11642+ completedAt,11643+ });11644+ context.assistant.fallbackText = "";11645+ }11646+ yield* sendHeldSteers(context);
juliusmarminge added labelstakeover:needs-julius
juliusmarminge removed labelstakeover:in-progress
github-actions[bot](GitHub profile, opens in a new tab) added labelsneeds-rebase
Alb11747(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Codex Review Summary: ❌ Failed
This comment shows the latest Codex review activity on this pull request.
We couldn’t complete this review. Comment
@codex reviewto try again.9210706ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.