Why this matters
After plugins remap config keys to display names, opencode run --agent NAME could miss the exact key and silently run default_agent.
Evidence
Tip 2dd9941d5b1a1eb325a6a143ed58c8735ab68cc8:
Live: cd packages/opencode && bun test test/cli/run/agent-flag.test.ts → 4 pass / 0 fail (exact match, case-insensitive match, unknown fail-closed, subagent reject)
Evidence class: BEHAVIORAL
Invariant: unknown --agent fails closed with the registered name list; subagents are never accepted as run agents.
Ask (design, light) — prospective; non-blocking
Should agent resolution always be name-based (display) rather than config-key-based?
For never-again: should every CLI selector that can remap names share one fail-closed resolver?
Fork mirror of a sealed OSS review draft. Not posted upstream.
origin: fix: fail closed on unknown --agent anomalyco/opencode#47091
tip: 2dd9941d5b1a1eb325a6a143ed58c8735ab68cc8
evidence: BEHAVIORAL — tip packages/opencode bun test test/cli/run/agent-flag.test.ts → 4/4 (exact/case match; unknown + subagent fail closed)
pack: 05 draft 006
dedupe_key: anomalyco/opencode#47091
github_writes_origin: 0
Why this matters
After plugins remap config keys to display names,
opencode run --agent NAMEcould miss the exact key and silently rundefault_agent.Evidence
Tip
2dd9941d5b1a1eb325a6a143ed58c8735ab68cc8:cd packages/opencode && bun test test/cli/run/agent-flag.test.ts→ 4 pass / 0 fail (exact match, case-insensitive match, unknown fail-closed, subagent reject)Invariant: unknown
--agentfails closed with the registered name list; subagents are never accepted as run agents.Ask (design, light) — prospective; non-blocking
Fork mirror of a sealed OSS review draft. Not posted upstream.
2dd9941d5b1a1eb325a6a143ed58c8735ab68cc8packages/opencodebun test test/cli/run/agent-flag.test.ts→ 4/4 (exact/case match; unknown + subagent fail closed)anomalyco/opencode#47091