GeezerVison is showing github.com — fix(session): agent.model and agent.variant config ignored in handleSubtask by naveen9036 · Pull Request #36281 · anomalyco/opencode
Conversation
naveen9036
commented
Jul 10, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Issue for this PR
Closes #36250
Type of change
- Bug fix
- New feature
- Refactor / code improvement
- Documentation
What does this PR do?
Fixes two bugs in handleSubtask where agent.model and agent.variant configured in opencode.json are silently ignored when a subagent is spawned.
taskAgent was being fetched after taskModel was already resolved, meaning the agent's configured model was never consulted.
variant was hardcoded to the parent session's variant, ignoring agent.variant.
Fix: Moved the taskAgent fetch before taskModel resolution, added taskAgent.model to the fallback chain, and prioritized taskAgent.variant over the parent session's variant.
How did you verify your code works?
Tested locally with Ollama to ensure the subagent correctly switches to the configured model from opencode.json. Also verified that bun run typecheck passes cleanly with 0 errors.
Screenshots / recordings
N/A (Backend logic fix, no UI changes)
Checklist
- I have tested my changes locally
- I have not included unrelated changes in this PR
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
mariusg0000, samiralibabic, aarjbdea, and 5ki reacted with thumbs up emoji
- Move taskAgent fetch before taskModel resolution so the agent's
configured model is available when deciding which model to use
- Add taskAgent.model as middle tier in the fallback chain:
task.model > agent.model > parent session model
- Use taskAgent.variant as preference over parent session variant
Closes anomalyco#21632
Re-fixes anomalyco#21952
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
This is an issue we have also noticed. I have just tested this locally and it works great!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Jul 24, 2026
|
This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2.
— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.