fix: preserve explicit model selection in command subtasks#18752
Open
Haohao-end wants to merge 3 commits intoanomalyco:devfrom
Open
fix: preserve explicit model selection in command subtasks#18752Haohao-end wants to merge 3 commits intoanomalyco:devfrom
Haohao-end wants to merge 3 commits intoanomalyco:devfrom
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found one potentially related PR: PR #17788: "fix: prioritize CLI --model argument over command markdown model"
This PR is related because both deal with model precedence and ensuring explicit model selections aren't overridden by fallback models. However, PR #17788 focuses on the CLI |
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 #18615
Type of change
What does this PR do?
This fixes model precedence in the command/subtask delegation path.
The bug was that an explicit
modelinput could still be overridden by an agent-configured fallback model when resolving a command/subtask request.I changed the precedence in
packages/opencode/src/session/prompt.tsso that it is now:Why this works:
How did you verify your code works?
I tested locally with:
cd packages/opencode && bun test test/session/prompt.test.ts --timeout 30000cd packages/opencode && bun run typecheckI also added focused regression coverage to verify that explicit model selection is preserved in the command/subtask path.
Screenshots / recordings
N/A (not a UI change)
Checklist