fix(schema): error on unknown command names, accept colon capability IDs - #169
Open
joshdholtz wants to merge 1 commit into
Open
fix(schema): error on unknown command names, accept colon capability IDs#169joshdholtz wants to merge 1 commit into
joshdholtz wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
rc schemaresolved its args with cobra'sFind, which never fails — it stops at the deepest match and hands back the leftovers. An unknown name (including the colon-form capability IDs thatrc commandsitself emits, likeapps: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 commandsworks; and any unresolved leftover is a hard error pointing atrc 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 schemanow treats colon-separated capability IDs fromrc 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
Findleaves unresolved tokens, the command fails with an error that points users torc 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.