fix(coding-agent): respect role thinking for temporary model picks#5297
Open
roboomp wants to merge 1 commit into
Open
fix(coding-agent): respect role thinking for temporary model picks#5297roboomp wants to merge 1 commit into
roboomp wants to merge 1 commit into
Conversation
Applied explicit thinking suffixes from matching configured model roles when the temporary model picker switches the session model. Added regression coverage for the Alt+P temporary picker resolution path. Fixes #5290
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.
Repro
A focused session repro configured
modelRoles.smol = google-antigravity/gemini-3.5-flash:high, verified the role resolver returnedhigh, then calledsetModelTemporary(selectedModel)as the temporary picker did. Before the fix,bun test tmp-repro-5290.test.tsfailed withExpected: "high"; Received: undefinedforsession.thinkingLevel.Cause
packages/coding-agent/src/modes/controllers/selector-controller.tshandled the Model HubonPickcallback by callingsession.setModelTemporary(model)without resolving explicit thinking metadata from configured roles.AgentSession.setModelTemporary()only applies a thinking level when its caller passes one, so the temporary picker bypassed the same role-thinking resolution used by role cycling inAgentSession.getRoleModelCycle()/applyRoleModel().Fix
AgentSession.resolveTemporaryModelThinkingLevel()to scan configured model roles, resolve their model selectors with existing match preferences, and return the explicit thinking suffix when a temporary pick matches that role's resolved model.Alt+P,/switch,/model --temporary) to pass that resolved thinking level intosetModelTemporary()while keeping the switch session-only.google-antigravity/gemini-3.5-flash:highso temporary picks apply the role override instead of falling back to the model/default thinking state.[Unreleased].Verification
bun test packages/coding-agent/test/agent-session-role-thinking.test.ts -t temporarypassed with 1 test, 5 assertions.bun test packages/coding-agent/test/agent-session-role-thinking.test.tspassed with 20 tests, 112 assertions.bun run checkinpackages/coding-agentpassed. Fixes #5290