Skip to content

fix(setup): ask instead of guessing on an unrecognised sub-action - #1391

Merged
potiuk merged 1 commit into
apache:mainfrom
potiuk:fix/setup-unknown-subaction
Sep 26, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
potiuk:fix/setup-unknown-subaction

Conversation

@potiuk

@potiuk potiuk commented Sep 26, 2026

Copy link
Copy Markdown
Member

Summary

  • setup's dispatch table had no rule for a first argument that matches no sub-action, so the agent guessed. In practice /magpie-setup:setup reconcie ran reconcile and upgrede ran upgrade without being asked, and upgrade / reconcile / adopt stage committed files.
  • Adds ### Unrecognised sub-action to setup/SKILL.md. On an unknown argument the skill prints Unknown setup sub-action, a did you mean for close matches (edit distance ≤ 2, or a prefix; all of them when several qualify), and the full sub-action list. It then waits and runs a suggestion only after the user confirms it.

Type of change

  • Skill change (.claude/skills/<name>/) — eval fixtures updated below
  • CI / dev loop (prek, workflows, validators) — regenerated surface_hash, docs/mode-economics.md token table, eval counts

Test plan

  • prek run --all-files passes
  • uv run --directory tools/skill-evals pytest -q passes
  • For skill changes: eval suite passes for the affected skill — not run locally (no claude CLI inside the sandbox this was authored in)
  • For skill behaviour changes: new eval suite evals/setup/step-unknown-subaction (4 cases). It covers a one-letter typo (upgrede → ask, suggest upgrade, run nothing), an exact name (reconcile → run), no close match (frobnicate → list only), and an ambiguous prefix (un → unadopt, uninstall).

RFC-AI-0004 compliance

  • HITL: an unrecognised argument no longer triggers any sub-action (and so no committed-file write) without explicit confirmation.

Notes for reviewers (optional)

The new subsection adds a ### heading, so setup's surface_hash changes. Adopters who have setup in their reconciled: stamp will see it proposed once on their next reconcile.

🤖 Generated with Claude Code

The dispatch table had no rule for a first argument matching no
sub-action, so a typo like `reconcie` or `upgrede` was silently mapped
to the nearest name and run. Print an unknown-sub-action message with
close-match suggestions and the full list, and wait for confirmation.

Adds eval suite evals/setup/step-unknown-subaction (4 cases).

Generated-by: Claude Opus 5
@potiuk potiuk added family:setup setup-* skills capability:fix Implement code change to resolve an issue labels Sep 26, 2026
@potiuk
potiuk merged commit 9b4203a into apache:main Sep 26, 2026
10 checks passed
potiuk added a commit to potiuk/magpie that referenced this pull request Sep 26, 2026
Pick up today's merges (apache#1390, apache#1391-apache#1394, apache#1398, apache#1399) in a fresh
marketplace build. pyproject.toml, uv.lock and every generated
plugin/marketplace manifest move from 0.9.0.dev202609251939.

Generated-by: Claude Opus 5
potiuk added a commit that referenced this pull request Sep 26, 2026
Pick up today's merges (#1390, #1391-#1394, #1398, #1399) in a fresh
marketplace build. pyproject.toml, uv.lock and every generated
plugin/marketplace manifest move from 0.9.0.dev202609251939.

Generated-by: Claude Opus 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capability:fix Implement code change to resolve an issue family:setup setup-* skills

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant