Skip to content

fix(agents): omit model: inherit so non-Claude tools don't see a bad model id#200

Merged
Lum1104 merged 1 commit into
Lum1104:mainfrom
AsimRaza10:fix/agent-model-omit-inherit
May 24, 2026
Merged

fix(agents): omit model: inherit so non-Claude tools don't see a bad model id#200
Lum1104 merged 1 commit into
Lum1104:mainfrom
AsimRaza10:fix/agent-model-omit-inherit

Conversation

@AsimRaza10
Copy link
Copy Markdown
Contributor

Summary

Fixes #167 (ProviderModelNotFoundError when running /understand on opencode + deepseek and similar setups).

model: inherit is a Claude Code-specific keyword meaning "use the parent session's model." Other tools that read the same agent frontmatter (opencode, codex, etc.) don't understand it — they treat inherit as a literal model id and forward it to whatever provider the user has configured, which rejects it.

Reproduction (from the issue):

I am using opencode with deepseek v4

│ Project-Scanner Task — Phase 1 SCAN project
ProviderModelNotFoundError

Maintainer already acknowledged: "Oops, seems deepseek thought inherit is a model name…."

Approach

Omit the model: field from all 9 agent frontmatters. With the field absent, each platform falls back to its own configured default:

  • Claude Code → user's default subagent model
  • opencode / codex / Gemini CLI / Antigravity / etc. → their globally configured model

This is the smallest change that unblocks non-Claude users without requiring install-time file rewriting (which would break the current symlink-based install flow in install.sh).

Trade-off worth flagging

Claude Code users running an Opus session previously had subagents auto-inherit Opus. After this change, subagents follow Claude Code's default-subagent-model setting instead — a single global config now controls all 9 agents. That's a behavior change worth surfacing in release notes; for users who want the old behavior, configuring the default subagent model globally restores it.

If you'd rather preserve model: inherit for Claude Code and strip it only for other platforms, that's a bigger change (install.sh would need to copy + transform agent files rather than symlink), and I'm happy to do that as a follow-up if you'd prefer.

Files changed

File Change
understand-anything-plugin/agents/architecture-analyzer.md drop model: inherit
understand-anything-plugin/agents/article-analyzer.md drop model: inherit
understand-anything-plugin/agents/assemble-reviewer.md drop model: inherit
understand-anything-plugin/agents/domain-analyzer.md drop model: inherit
understand-anything-plugin/agents/file-analyzer.md drop model: inherit
understand-anything-plugin/agents/graph-reviewer.md drop model: inherit
understand-anything-plugin/agents/knowledge-graph-guide.md drop model: inherit
understand-anything-plugin/agents/project-scanner.md drop model: inherit
understand-anything-plugin/agents/tour-builder.md drop model: inherit
CLAUDE.md update the agent-pipeline note to reflect the new convention and reference the issue

Test plan

  • All 9 agent frontmatters still parse (verified visually — frontmatter delimiters intact, no orphan keys)
  • No source-side test or schema references model: inherit (grep returns clean)
  • Maintainer to verify against Claude Code, opencode + Anthropic, and opencode + deepseek
  • Maintainer to decide whether the global-default trade-off is acceptable, or whether to go with the per-platform install transformation instead

Closes #167

…d model id

`model: inherit` is a Claude Code-specific keyword that means "use the
parent session's model." Other tools that read the same agent frontmatter
(opencode, codex, etc.) don't understand it and instead try to use
`inherit` as a literal model id, which the configured provider rejects.

Reproduction (from Lum1104#167): opencode + deepseek runs `/understand`, the
project-scanner subagent dispatches with `model: inherit`, deepseek
returns `ProviderModelNotFoundError`, and the pipeline halts on every
subagent dispatch.

With the field omitted, each platform falls back to its own configured
default:
- Claude Code: user's default subagent model
- opencode / codex / etc.: globally configured model

Note for Claude Code Opus users: subagents will no longer auto-inherit
the Opus session model. If you want the previous behavior, set your
default subagent model globally — that single setting now controls all
nine agents.

Closes Lum1104#167
@AsimRaza10
Copy link
Copy Markdown
Contributor Author

@Lum1104 friendly ping when you get a chance — small agent config fix so Cursor/opencode don't choke on model: inherit as an invalid model id. Low-risk diff, happy to adjust scope or rework if you'd prefer a different approach. Thanks!

@Lum1104
Copy link
Copy Markdown
Owner

Lum1104 commented May 24, 2026

Hi, I was wondering how to do the update if we let install.sh to remove this line. Since git pull won't work after that.

@Lum1104 Lum1104 merged commit 470cc01 into Lum1104:main May 24, 2026
1 check passed
@AsimRaza10
Copy link
Copy Markdown
Contributor Author

Good catch — you're right, that's exactly why I went with the source-side approach rather than install-time rewriting. If install.sh mutated agent files in $REPO_DIR/understand-anything-plugin/agents/ directly, the next --update would hit git pull --ff-only against a dirty working tree and refuse (or conflict if upstream touched the same lines).

If we ever wanted to bring back per-platform transformation, the only way to keep --update working would be to stop linking the source files and instead render them to a separate dir, e.g.:

  1. After git pull, run a render step that copies agents/*.md$REPO_DIR/.rendered/<platform>/agents/*.md, applying per-platform transforms (strip model: inherit for non-Claude, keep it for Claude Code).
  2. Symlinks point at .rendered/<platform>/ instead of the source tree.
  3. .rendered/ is gitignored, so git pull stays clean.

That's more moving parts than the current symlink design buys us, though, and it adds a re-render step every update. The merged approach trades the Claude-Code Opus auto-inheritance behavior for one global subagent-model setting, which I think is the better deal for a multi-platform plugin — but happy to do the rendering pass as a follow-up if you'd rather restore the old Claude Code behavior without breaking other tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ProviderModelNotFoundError ERROR

2 participants