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(core): let subagents pick a model and expose models tool by rekram1-node · Pull Request #49194 · anomalyco/opencode

Conversation

@rekram1-node

@rekram1-node rekram1-node commented Sep 15, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Follow-up to #49129. Lets an agent resolve a model the user names loosely ("luna", "glm flash", "sonnet with high reasoning") into an exact reference on its own provider, and run a subagent on it.

tools.opencode.models({ query?, provider?, all?, limit?, offset? })

Codemode tool. Output is grouped by provider — { providers: [{ id, name, models: [{ id: "providerID/modelID", name, released, variants, cost, status }] }], total, next } — the caller's own provider first, then alphabetical, newest first within each provider. The opencode namespace description now mentions model search so agents can find the tool from the catalog header without it being pinned.

  • query matches every word against providerID/modelID and the display name, so "glm flash" finds glm-5.3-flash.
  • provider filters by provider id or name.
  • By default only the newest model per (provider, family) is listed, applied after query; all: true includes older versions. This removes the "picked claude-sonnet-4-6 because it was in the list" failure without prompt text about versions.
  • Paging over the ordered list; default 20, max 100.

model on the subagent tool

Optional "providerID/modelID" or "providerID/modelID#variant". Precedence: explicit input > agent's configured model > parent's model; validated against Model.available() (ref and variant). Passing model while continuing a child switches its model, mirroring agent switching. The agent input now notes that an unrecognized subagent name most likely refers to a model.

Identity block

# Your Model now reads Name / Provider ID / Model ID instead of Provider: <display name>. Agents were passing the first word of the display name ("anomaly") as a provider filter and getting zero results.

Evaluation

Drove opencode/gpt-5.6-luna, opencode/glm-5.3-flash, and opencode/muse-spark-1.3 through the HTTP API on nickname prompts that never mention a provider, plus a control with no model named. Scored by the child session's actual model. Baseline (tool present, first wording) was 9/15: refs guessed from memory (anthropic/claude-sonnet-4-5, muse/spark, opencode/luna), wrong providers, stale versions. Final configuration: 86/90 across six rounds, typical path search → models → subagent in 4 steps, every lookup-based pick on the agent's own provider and newest version, every control omitting model. Every miss was a run that never called the tool (guessed a reference from memory or shelled out to the installed CLI); every run that used the tool picked correctly.

Tests: tool-opencode.test.ts (grouping, paging across a group boundary, provider by id/name, multi-word query, family collapsing with all, disabled exclusion), tool-subagent.test.ts (override on create, switch on continue, three validation failures), identity.test.ts and the session-runner cassette for the identity block.

Sorry, something went wrong.

Uh oh!

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

All reactions
@rekram1-node rekram1-node changed the title feat(core): let subagents pick a model and expose model_list feat(core): let subagents pick a model and expose models tool Sep 15, 2026
rekram1-node added 7 commits September 15, 2026 21:11
@rekram1-node
feat(core): let subagents pick a model and expose model_list
46c828c
@rekram1-node
fix(core): rename model_list to models and clarify unavailable model …
1f0667b
…error
@rekram1-node
refactor(core): reword model selection prompts and errors
5fafd6f
@rekram1-node
refactor(core): drop examples from model prompts and add variant guid…
03cce40
…ance
@rekram1-node
refactor(core): tighten subagent model input wording
c9b9c59
@rekram1-node
feat(core): paginate the models tool with an agent-facing shape
a94a562
@rekram1-node
fix(core): label provider and model ids in the identity block
8d07ecc
@rekram1-node
rekram1-node force-pushed the subagent-model branch from b1aa63b to 0dbd995 Compare September 16, 2026 05:30
@rekram1-node
feat(core): make the models tool searchable and guide subagent model …
a46c146
…selection
@rekram1-node
rekram1-node force-pushed the subagent-model branch from 0dbd995 to a46c146 Compare September 16, 2026 05:31
rekram1-node added 2 commits September 16, 2026 00:37
@rekram1-node
fix(core): say when a model has no variants instead of listing none
1f6afd7
@rekram1-node
feat(core): list the caller's provider first in the models tool
2db163a
@rekram1-node
rekram1-node merged commit 7d7962b into v2 Sep 16, 2026
10 checks passed

Uh oh!

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

@rekram1-node
rekram1-node deleted the subagent-model branch September 16, 2026 06:16
@trin4ik

trin4ik commented Sep 23, 2026

Copy link
Copy Markdown

https://github.com/anomalyco/opencode/blob/v2.0.15/packages/core/src/tool/plugin/subagent.ts#L36-L39
What is the point of using such wording? "NEVER" breaks the spawning of sub-agents for skills using the specified model.

All reactions

Sorry, something went wrong.

Uh oh!

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

jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
@rekram1-node
feat(core): let subagents pick a model and expose models tool (anomal…
66c9d27
…yco#49194)
This was referenced Oct 1, 2026
[FEATURE]: Dynamic model selection for subagents via Task tool #6651
Closed
[FEATURE]: opencode could automatically use different models based on task type #8456
Closed
@balboah balboah mentioned this pull request Oct 1, 2026
chore(subagent-model): remove plugin superseded by native OpenCode support joonix/opencode-plugins#1
Merged
@neriousy neriousy mentioned this pull request Oct 21, 2026
feature(core): expose active model identifier to the agent runtime #39159
Closed
This was referenced Oct 22, 2026
nav-pilot: track authorization of OpenCode v2 subagent model overrides navikt/copilot#1905
Closed
nav-pilot: evaluate an Astra code-review subagent navikt/copilot#1892
Open
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.

2 participants

@rekram1-node @trin4ik
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.