Skip to content

fix(schema): error on unknown command names, accept colon capability IDs - #169

Open
joshdholtz wants to merge 1 commit into
mainfrom
schema-unknown-command-error
Open

fix(schema): error on unknown command names, accept colon capability IDs#169
joshdholtz wants to merge 1 commit into
mainfrom
schema-unknown-command-error

Conversation

@joshdholtz

@joshdholtz joshdholtz commented Sep 9, 2026

Copy link
Copy Markdown
Member

rc schema resolved its args with cobra's Find, which never fails — it stops at the deepest match and hands back the leftovers. An unknown name (including the colon-form capability IDs that rc commands itself emits, like apps:create) silently produced the root schema with exit 0, so an agent's natural discovery loop got a valid-looking empty schema and concluded the command takes nothing.

Two changes: colon-form IDs are now split and resolved as command paths, so pasting straight from rc commands works; and any unresolved leftover is a hard error pointing at rc commands.

Fixes #147

🤖 Generated with Claude Code


Note

Low Risk
CLI introspection-only behavior change with clearer errors; no auth, data, or runtime command execution impact.

Overview
rc schema now treats colon-separated capability IDs from rc commands (e.g. apps:create) like space-separated paths by splitting on : before lookup, so agents can paste IDs directly.

Unknown or partial command names no longer return the root schema with exit 0: if Cobra’s Find leaves unresolved tokens, the command fails with an error that points users to rc commands.

Tests cover the error path for bogus IDs and successful resolution for apps:create.

Reviewed by Cursor Bugbot for commit 6ab8d70. Bugbot is set up for automated code reviews on this repo. Configure here.

cobra's Find falls back to the deepest match instead of failing, so an
unknown name silently returned the root schema with exit 0 — an agent
pasting a capability ID from rc commands (apps:create) got a valid-looking
empty schema. Colon IDs now resolve as paths, and anything unresolved is a
hard error.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 9, 2026 14:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

rc schema silently returns the root schema for an unknown command arg

2 participants