GeezerVison is showing github.com — feat: add assign-model feature for subagent model selection by VenTheZone · Pull Request #17570 · anomalyco/opencode
Conversation
VenTheZone
commented
Mar 15, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Issue for this PR
Closes #
Type of change
- Bug fix
- New feature
- Refactor / code improvement
- Documentation
What does this PR do?
Adds the ability to assign specific AI models to subagents via config and UI. This allows users to specify which models subagents should use without modifying agent definitions.
Changes:
- Added subagent_model_assignments field to opencode.json config
- Implemented global + project-specific scope (project overrides global)
- Added Desktop UI: multi-step dialog (agent → provider → model → scope)
- Added TUI: /assign-model command with Ctrl+X P keybind
- Subagents automatically use assigned models at runtime
- Changes restart the current session to apply immediately
How did you verify your code works?
- Ran bun typecheck - passes
- Ran bun test in packages/opencode - all assign-model tests pass
- Verified config merge behavior with unit tests
- Tested subagent model resolution with mocked providers
Screenshots / recordings
Screenshot will be uploaded later today.
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.
Paatricious reacted with rocket emoji
Why: Users need to specify which AI models subagents should use without
modifying agent definitions. This enables per-subagent model preferences
that persist across sessions and can be scoped globally or per-project.
What changed:
- Add subagent_model_assignments config field (global + project scoped)
- Implement model resolution at runtime for subagent task execution
- Add Desktop UI with multi-step dialog (agent→provider→model→scope)
- Add TUI dialog with Ctrl+X P keybind (verified no conflicts)
- Add /assign-model slash command in both interfaces
- Add comprehensive tests for config merging and model resolution
- Regenerate SDK types for new config field
Project config overrides global for individual agents. Changes take
effect immediately by restarting the current session experience.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
I have something like this here: #11217
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
I have something like this here: #11217
It shouldnt conflict though. Yours is more direct, mines a list of connected API, a selection like how you would change models for the main agent
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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 was referenced Mar 21, 2026
This was referenced May 5, 2026
|
Automated PR Cleanup
Thank you for contributing to opencode.
Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.
This PR was closed because it matched the following cleanup criteria:
- The PR was created more than 1 month ago
- The PR had fewer than 2 positive reactions
- Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR
PRs created within the last month are not affected by this cleanup.
If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.
Thanks again for taking the time to contribute.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Wanted to create a PR for exactly this, but OP's idea is spot on what I would like to have in Opencode too.
"At dispatch time, a native prompt showing "which agent, which model" for that task - chosen per session, everything interchangeable on the fly"
+support from me.
|
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
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|