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(opencode): add model override for task tool subagents by Quadina · Pull Request #17577 · anomalyco/opencode

Conversation

@Quadina

@Quadina Quadina commented Mar 15, 2026

Copy link
Copy Markdown

Issue for this PR

N/A — new feature proposal, no existing issue.

Type of change

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

What does this PR do?

Adds a model parameter to the task tool so callers can override which model a subagent uses (format: "provider/model-id"). This is useful when a user explicitly asks to run a task on a specific model (e.g. "do this on opus").

The override is gated by a new model_override permission that is denied by default. Users must explicitly allow models in their config before an LLM can switch models autonomously. This prevents prompt injection attacks where a malicious instruction could escalate to a more expensive or capable model.

Config examples:

{ "permission": { "model_override": "allow" } }
{ "permission": { "model_override": { "anthropic/*": "allow" } } }
{ "permission": { "model_override": { "anthropic/claude-opus-4-0520": "allow", "*": "deny" } } }

Changes:

  • task.ts: new model param in schema, exported parseModel() helper, ctx.ask() with model_override permission before using override. Also fixed a preexisting TS error (union narrowing on msg.info).
  • agent.ts: model_override: "deny" in default permission ruleset.
  • config.ts: model_override: PermissionRule.optional() in Permission schema.
  • task.txt: documented the new parameter and permission requirement.
  • test/tool/task.test.ts: 13 tests covering parseModel parsing and model_override permission evaluation (default deny, specific model allow, provider wildcard, global allow, ask, per-agent config).

How did you verify your code works?

  • bun test test/tool/task.test.ts — 13/13 pass
  • bun typecheck — clean (0 errors)

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
@github-actions

github-actions Bot commented Mar 15, 2026

Copy link
Copy Markdown
Contributor

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

Potential duplicate found:

  • PR feat: add assign-model feature for subagent model selection #17570 - "feat: add assign-model feature for subagent model selection"
    feat: add assign-model feature for subagent model selection #17570

    Why it's related: This PR appears to be addressing the same core feature—allowing model selection/override for subagents. Both PRs seem to be working on enabling callers to specify which model a subagent should use, which is very likely duplicate work.

All reactions

Sorry, something went wrong.

Uh oh!

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

@Quadina

Quadina commented Mar 15, 2026

Copy link
Copy Markdown
Author

Not a duplicate — different scope.

#17570 is a user-facing feature: the user manually assigns models to subagents via UI or config. Our PR is an agent-facing runtime override: the LLM itself can specify a model when delegating to a subagent via the task tool.

A concrete use case: an orchestrator agent running an implement→review loop can dynamically pick a different model for each iteration — e.g. use a fast/cheap model for implementation and a more capable one for review, or escalate to a stronger model after a failed review. That's not something a static config assignment covers.

The override is gated by a new model_override permission (denied by default), so users stay in control of which models an agent is allowed to switch to.

All reactions

Sorry, something went wrong.

Uh oh!

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

@Quadina Quadina mentioned this pull request Mar 15, 2026
[FEATURE]: Runtime model override for task tool subagents #17595
Closed
1 task done
@Quadina

Quadina commented Mar 15, 2026

Copy link
Copy Markdown
Author

Linked to #17595 — this PR closes that issue.

All reactions

Sorry, something went wrong.

Uh oh!

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

TestUser added 2 commits March 17, 2026 17:06
TestUser
feat(opencode): add model override for task tool subagents
1c56527
Allow callers to specify a model when delegating to a subagent via the
task tool. The override is gated by a new "model_override" permission
(denied by default) so users must explicitly allow models or providers
in their config before an LLM can switch models autonomously.
TestUser
ci: retry typecheck
1b312bd
@github-actions github-actions Bot mentioned this pull request Mar 21, 2026
fix(task): propagate subagent provider errors to orchestrator #18509
Closed
TestUser
chore: resolve merge conflicts with origin/dev
9425318
@Quadina
Quadina force-pushed the feat/task-model-override branch from cbe07c6 to 9425318 Compare March 21, 2026 13:54
@Quadina Quadina closed this Mar 21, 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.

Uh oh!

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

1 participant

@Quadina
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.