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 — fix(agent): honor model:inherit in subagent frontmatter by flacks · Pull Request #17888 · anomalyco/opencode

Conversation

@flacks

@flacks flacks commented Mar 17, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Issue for this PR

Closes #17890.

Type of change

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

What does this PR do?

Agents with model: inherit had "inherit" passed to Provider.parseModel(), producing { providerID: "inherit", modelID: "" }. The non-null result caused task.ts to skip its ?? fallback to the parent session's model, resulting in a ProviderModelNotFoundError on every subagent invocation.

Fix: skip parseModel when model value is "inherit", leaving item.model undefined so the parent model is inherited as intended.
Tested with get-shit-done global install (~/.config/opencode/agents/).

How did you verify your code works?

Tested with get-shit-done global install (~/.config/opencode/agents/).

Screenshots / recordings

image

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.

ariane-emory reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Copilot AI review requested due to automatic review settings March 17, 2026 02:31
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Mar 17, 2026
@github-actions

github-actions Bot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

All reactions

Sorry, something went wrong.

Uh oh!

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

Copilot started reviewing on behalf of flacks March 17, 2026 02:31
View session
Copilot AI reviewed Mar 17, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes agent/model handling and improves the agent-selection UX in the TUI so subagents are visible and “model inheritance” behaves as intended.

Changes:

  • Skip Provider.parseModel() when an agent config sets model: "inherit", allowing the agent to fall back to the session/parent model.
  • Expose listAll() on the TUI local agent context to return all non-hidden agents (including subagents).
  • Update the /agents dialog to use listAll() and group entries into “Primary” vs “Subagents”.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/opencode/src/cli/cmd/tui/context/local.tsx Adds listAll() and improves set() warnings to distinguish subagents vs missing agents.
packages/opencode/src/cli/cmd/tui/component/dialog-agent.tsx Switches dialog options to listAll() and categorizes agents for grouping.
packages/opencode/src/agent/agent.ts Treats model: "inherit" as “no explicit model” by skipping parseModel.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread packages/opencode/src/cli/cmd/tui/component/dialog-agent.tsx Outdated
return {
value: item.name,
title: item.name,
description: item.native ? "native" : item.description,
category: item.mode === "subagent" ? "Subagents" : "Primary",
Comment thread packages/opencode/src/agent/agent.ts
@@ -217,7 +217,7 @@ export namespace Agent {
options: {},
native: false,
}
if (value.model) item.model = Provider.parseModel(value.model)
if (value.model && value.model !== "inherit") item.model = Provider.parseModel(value.model)
@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Mar 17, 2026
@github-actions

github-actions Bot commented Mar 17, 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 removed the needs:issue label Mar 17, 2026
@flacks
flacks force-pushed the fix/subagents branch from b69037e to 253ab90 Compare March 17, 2026 12:07
@ariane-emory

ariane-emory commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

Subagents are not meant to show up in the modal dialogue that the /agents command produces as they cannot be selected for use.

All reactions

Sorry, something went wrong.

Uh oh!

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

@flacks
flacks force-pushed the fix/subagents branch from 253ab90 to fcade1a Compare March 17, 2026 15:13
@flacks flacks changed the title fix(agent): honor model:inherit and show subagents in /agents dialog fix(agent): honor model:inherit in subagent frontmatter Mar 17, 2026
@flacks

flacks commented Mar 17, 2026

Copy link
Copy Markdown
Author

Subagents are not meant to show up in the modal dialogue that the /agents command produces as they cannot be selected for use.

Agreed, fixed.

ariane-emory reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@flacks
fix(agent): honor model:inherit in subagent frontmatter
7a6a8ba
Agents with `model: inherit` had "inherit" passed to Provider.parseModel(),
producing { providerID: "inherit", modelID: "" }. The non-null result caused
task.ts to skip its ?? fallback to the parent session's model, resulting in
a ProviderModelNotFoundError on every subagent invocation.

Fix: skip parseModel when model value is "inherit", leaving item.model
undefined so the parent model is inherited as intended.

Tested with get-shit-done global install (~/.config/opencode/agents/).
@flacks
flacks force-pushed the fix/subagents branch from fcade1a to 7a6a8ba Compare March 17, 2026 15:18
This was referenced Mar 21, 2026
feat(task): add model override for subagents #18528
Closed
feat(plugin): add chat.model hook for dynamic model routing for token savings #18826
Closed
@opencode-agent
opencode-agent Bot force-pushed the dev branch from 2f2ed11 to 9f201d6 Compare April 16, 2026 21:55
@marcusrbrown marcusrbrown mentioned this pull request May 5, 2026
fix(agents): omit model field from all 50 bundled agents marcusrbrown/systematic#336
Merged
marcusrbrown added a commit to marcusrbrown/systematic that referenced this pull request May 5, 2026
@marcusrbrown
fix(agents): omit model field from all 50 bundled agents (#336)
072e755
* fix(agents): omit model field from all 50 bundled agents

OpenCode's docs say subagents with no model field inherit the invoking
primary agent's model — the desired portable behavior. The literal
`model: inherit` was undocumented and produced ProviderModelNotFoundError
on OpenCode older than ~v1.13.x (pre anomalyco/opencode#17888). Omitting the
field works on every OpenCode version.

Strip model: inherit from all 50 bundled agents.

Flip the content-integrity gate: previously required `model: inherit`,
now requires the field to be absent. Update the violation message to
explain the why and link to the OpenCode docs and upstream PR.

Update test fixtures for both directions:
- writeAgent helper now writes agents without a model field
- the suite that previously asserted "missing/non-inherit/empty/null"
  as violations now asserts "any present model value (including the
  literal 'inherit')" as violations
- the integration test that constructed an agent fixture with no
  model field to trigger a violation now constructs one with
  `model: inherit` (which, post-flip, is a violation)

Refs: https://opencode.ai/docs/agents/, anomalyco/opencode#17888

* docs(writing-systematic-skills): reverse model: inherit guidance

The skill spec previously mandated model: inherit for bundled agents.
Update the spec to require omitting the model field instead.

The why is the same as the agent change: subagents with no model field
inherit from the invoking primary agent per OpenCode's docs, which is
the portable behavior. model: inherit was undocumented and broken on
OpenCode pre anomalyco/opencode#17888.

Updates:
- SKILL.md: reverse Identity Defaults section, common-mistakes table,
  validator rule list, and the spec summary bullet.
- references/foundation-conventions.md: same reversal in the long-form
  Identity Defaults section, plus update the optional-fields table to
  show a non-inherit example for skill-level model overrides.

The auto-generated docs/src/content/docs/reference/* files are
gitignored and re-generated by bun run docs:generate during build.

Refs: https://opencode.ai/docs/agents/, anomalyco/opencode#17888

* docs(AGENTS): document bundled-agent model omission policy

Surface the no-model-field convention in repo-level AGENTS.md so
contributors discover it at authoring time, not at CI failure. Cites
the OpenCode docs (subagents inherit when model is unset) and the
upstream PR that special-cased the literal "inherit" string in
March 2026.

The content-integrity gate already enforces this; this commit is a
discoverability mirror for human contributors and AI agents reading
AGENTS.md before authoring.

Refs: https://opencode.ai/docs/agents/, anomalyco/opencode#17888
@rekram1-node

rekram1-node commented May 15, 2026

Copy link
Copy Markdown
Member

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.

All reactions

Sorry, something went wrong.

Uh oh!

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

@rekram1-node rekram1-node closed this May 15, 2026
@yjlc-pc yjlc-pc mentioned this pull request Jun 21, 2026
fix(agent): skip parseModel when model is "inherit", trim whitespace #33202
Closed
3 of 6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

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.

model: inherit in agent frontmatter causes ProviderModelNotFoundError; subagents hidden from /agents dialog

Uh oh!

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

4 participants

@flacks @ariane-emory @rekram1-node
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.