Skip to content

fix(cli): fail closed on unknown --agent after remapping - #62

Open
kvnloo wants to merge 3 commits into
devfrom
fix/run-agent-fail-closed-v3
Open

kvnloo wants to merge 3 commits into
devfrom
fix/run-agent-fail-closed-v3

Conversation

@kvnloo

@kvnloo kvnloo commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fail closed for opencode run --agent NAME instead of silently falling back to the default agent.

Exact and case-insensitive primary-agent names resolve. Unknown names and subagents exit with a useful error listing registered primary agents.

Credit / provenance

This is a current-dev refresh of upstream anomalyco#47091 by @RaviTharuma. Credit for the original diagnosis and fail-closed behavior belongs to them. This downstream refresh keeps the focused resolver/tests while adapting it to the current run-command tree.

Current refresh

  • rebased cleanly onto current dev on 2026-10-03
  • 0 commits behind
  • only run.ts, the small agent-flag.ts helper, and its test changed
  • stale unrelated lockfile / browser-opening changes were explicitly removed

Verification

The previous focused proof was 4 passing resolver tests. Current upstream CI should revalidate the refreshed head.

github_writes_origin=0 — ready to promote when upstream write access is available.

@github-actions

Copy link
Copy Markdown

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.

@github-actions

Copy link
Copy Markdown

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@kvnloo
kvnloo force-pushed the fix/run-agent-fail-closed-v3 branch from 2dfa012 to c77f3b1 Compare October 3, 2026 21:18
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.

1 participant