Repository navigation
fix(server): a model change sent with a Claude steer now applies to the running turn #34564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
21fe613
e951daa
fa38be1
ec23b66
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12018,11 +12018,26 @@ export const makeClaudeAdapterV2 = Effect.fn("makeClaudeAdapterV2")(function* ( | |
| }), | ||
| persistAttachmentBudget(existing.nativeThreadId), | ||
| ); | ||
| // A selection sent with the steer applies to the running turn when the live process can switch to it. | ||
| const steerSelection = | ||
| turnInput.modelSelection === undefined | ||
| ? undefined | ||
| : compileClaudeModelSelection(turnInput.modelSelection, modelCatalog); | ||
| const liveSteerSelection = | ||
| steerSelection !== undefined && | ||
| existing.selection.queryIdentity !== steerSelection.queryIdentity && | ||
| canApplyClaudeSelectionLive(existing.selection, steerSelection) && | ||
| (existing.selection.apiModelId === steerSelection.apiModelId || | ||
| existing.openedPermissionMode === currentTurn.queryPolicy.permissionMode) | ||
| ? steerSelection | ||
| : undefined; | ||
| const userMessage = yield* makeClaudeUserMessageWithAttachments({ | ||
| text: applyClaudePromptEffortPrefix( | ||
| turnInput.message.text, | ||
| compileClaudeModelSelection(currentTurn.input.modelSelection, modelCatalog) | ||
| .promptEffort, | ||
| ( | ||
| liveSteerSelection ?? | ||
| compileClaudeModelSelection(currentTurn.input.modelSelection, modelCatalog) | ||
|
Comment on lines
+12038
to
+12039
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| ).promptEffort, | ||
| ), | ||
| attachments: turnInput.message.attachments, | ||
| priority: "now", | ||
|
|
@@ -12036,9 +12051,12 @@ export const makeClaudeAdapterV2 = Effect.fn("makeClaudeAdapterV2")(function* ( | |
| Effect.provideService(Path.Path, path), | ||
| ); | ||
| yield* backgroundForegroundSubagents(existing, backgroundDeadline); | ||
| // The turn can end while the moves are answered. A steer offered | ||
| // then would start a new turn the orchestrator never asked for, so | ||
| // the steer fails and the orchestrator starts the follow-up turn. | ||
| if (liveSteerSelection !== undefined) { | ||
| yield* applySelectionLive(existing, liveSteerSelection); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } | ||
| // The turn can end while the moves or the selection change are answered. | ||
| // A steer offered then would start a new turn the orchestrator never | ||
| // asked for, so the steer fails and the orchestrator starts the follow-up turn. | ||
| if ( | ||
| (yield* Ref.get(activeTurn))?.providerTurnId !== turnInput.providerTurnId || | ||
| (yield* Ref.get(queryContext)) !== existing || | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Medium
Adapters/ClaudeAdapterV2.ts:11971After a model-changing steer, later messages use the turn-start prompt effort instead of the active selection's effort.
applySelectionLiveupdatesexisting.selection, but a subsequent steer requesting that same selection leavesliveSteerSelectionundefined, so this fallback recompilescurrentTurn.input.modelSelectionand can restoreUltrathink:after switching to ordinary effort. Useexisting.selectionas the fallback.🚀 Reply "fix it for me" or copy this AI Prompt for your agent: