GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: add model parameter to Task tool for dynamic subagent model selection by albahrani · Pull Request #14961 · anomalyco/opencode

Conversation

@albahrani

@albahrani albahrani commented Feb 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Issue for this PR

Closes #6651

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds an optional model parameter to the Task tool so callers can specify which model a subagent runs on at invocation time, instead of relying solely on static agent config or parent session fallback.

The resolution order becomes: params.model > agent.model > parent session model. Existing behavior is unchanged when the parameter is omitted.

This is needed for orchestrator workflows (e.g. gsd-opencode) where different subagents should use different model tiers based on their role, determined dynamically at call time.

How did you verify your code works?

Built from source on Windows, replaced the installed binary, and tested three scenarios:

Test model param Agent frontmatter Expected Actual
Dynamic override to Haiku github-copilot/claude-haiku-4.5 (none) Haiku Haiku
Dynamic override to Sonnet github-copilot/claude-sonnet-4.6 (none) Sonnet Sonnet
No param, no frontmatter (none) (none) Opus (parent) Opus

Verified by spawning subagents and checking the model ID in their system prompt.

Screenshots / recordings

Not a UI change.

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.

All reactions
Alexander Al-Bahrani
feat: add model parameter to Task tool for dynamic subagent model sel…
4f38cb7
…ection
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Feb 24, 2026
@github-actions

github-actions Bot commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found the following potentially related PRs:

Related PRs:

  1. PR feat(agent): implement model tier selection with variant support for subagents #11377 - feat(agent): implement model tier selection with variant support for subagents

    • feat(agent): implement model tier selection with variant support for subagents #11377
    • This PR also addresses dynamic model selection for subagents, which is closely related to the current PR's goal of allowing different subagents to use different model tiers.
  2. PR feat(task): pass variant to subagent so it inherits parent's thinking level #12567 - feat(task): pass variant to subagent so it inherits parent's thinking level

    • feat(task): pass variant to subagent so it inherits parent's thinking level #12567
    • This PR deals with passing configuration parameters to subagents, which is similar in scope to passing the model parameter.
  3. PR feat: add agent default variant handling in TUI and desktop #7156 - feat: add variant support for subagents (#7138) [alt of #7140]

    • feat: add agent default variant handling in TUI and desktop #7156
    • This PR also addresses passing parameters/variants to subagents for dynamic behavior.

These PRs appear to be related efforts in enabling dynamic subagent configuration. You may want to review them to ensure there's no overlap in implementation or to see if this PR should be coordinated with existing variant/model selection mechanisms.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@albahrani

albahrani commented Feb 24, 2026

Copy link
Copy Markdown
Author

Thanks for flagging the related PRs. Here's how this one fits in:

  • feat(agent): implement model tier selection with variant support for subagents #11377 (model tiers) — Adds model_tier enum (quick/standard/advanced) with configurable tier-to-model mappings. Our PR adds the lower-level raw model parameter. These are complementary — tiers are a user-friendly abstraction, the raw parameter covers cases where the caller already knows the exact model ID (e.g. orchestrator frameworks that resolve models from their own config).

  • feat(task): pass variant to subagent so it inherits parent's thinking level #12567 (variant inheritance) — Passes the parent's thinking variant to subagents. Orthogonal to model selection — variant controls reasoning depth, model controls which LLM runs. No overlap.

  • feat: add agent default variant handling in TUI and desktop #7156 (static agent variant) — Adds a variant field to agent config. Also orthogonal — deals with variants, not model selection.

This PR is intentionally minimal (9 lines, 2 files) to provide the foundational mechanism. It doesn't conflict with any of the above and could serve as a building block for #11377's tier resolution.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@marcusquinn marcusquinn mentioned this pull request Feb 25, 2026
feat(agent): add subagents config for per-agent task tool filtering #7271
Closed
@github-actions github-actions Bot mentioned this pull request Mar 15, 2026
feat: add assign-model feature for subagent model selection #17570
Closed
3 of 6 tasks
@gexdigital gexdigital mentioned this pull request Mar 17, 2026
[Bug] Subagent spawned via Task tool uses global config model instead of inheriting parent session's active model #17870
Closed
@github-actions github-actions Bot mentioned this pull request Mar 22, 2026
feat(opencode): add native dynamic subagent task support #18588
Closed
3 of 6 tasks
@v1truv1us v1truv1us mentioned this pull request Mar 22, 2026
[FEATURE]: Dynamic Model Routing via Plugin Hook - Update Active Model State #18644
Closed
1 task done
@github-actions github-actions Bot mentioned this pull request Mar 23, 2026
feat(plugin): add chat.model hook for dynamic model routing for token savings #18826
Closed
2 of 6 tasks
@opencode-agent
opencode-agent Bot force-pushed the dev branch from 2f2ed11 to 9f201d6 Compare April 16, 2026 21:55
@github-actions

github-actions Bot commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot closed this Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Dynamic model selection for subagents via Task tool

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@albahrani
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.