fix(acp): session/set_mode now activates agent's configured model#18621
Open
systemfreund wants to merge 1 commit intoanomalyco:devfrom
Open
fix(acp): session/set_mode now activates agent's configured model#18621systemfreund wants to merge 1 commit intoanomalyco:devfrom
systemfreund wants to merge 1 commit intoanomalyco:devfrom
Conversation
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
ee97605 to
314af37
Compare
When switching agents via session/set_mode, only the session's modeId was updated but the model remained unchanged. This caused the session to keep using the previously configured (or default) model instead of the model configured for the selected agent. Now setSessionMode() also updates session.model and session.variant when the selected agent has a configured model, matching the behavior users expect when switching agents. Closes anomalyco#18620 Ref anomalyco#7099
314af37 to
101e8c4
Compare
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.
Issue for this PR
Closes #18620
Type of change
What does this PR do?
session/set_modeonly updatedsession.modeIdbut never calledsetModel()/setVariant(), so the session kept using the default or previously configured model instead of the one configured for the selected agent.The root cause is twofold:
loadAvailableModes()strippedmodelandvariantfrom agent configs when building the mode list, sosetSessionMode()had no model data available.setSessionMode()only calledthis.sessionManager.setMode()without updating the model.The fix extends
ModeOptionto carrymodelandvariant, passes them through inloadAvailableModes(), and adds thesetModel()/setVariant()calls insetSessionMode()when the selected agent has a configured model.Ref #7099
How did you verify your code works?
packages/opencode/test/acp/set-session-mode.test.ts— all passScreenshots / recordings
N/A — backend/protocol change, no UI.
Checklist