Skip to content

fix(skills): route show/info/list-filter to local, not model invoke#2988

Merged
code-yeongyu merged 1 commit intomainfrom
fix/skills-show-filter-no-invoke
May 4, 2026
Merged

fix(skills): route show/info/list-filter to local, not model invoke#2988
code-yeongyu merged 1 commit intomainfrom
fix/skills-show-filter-no-invoke

Conversation

@code-yeongyu
Copy link
Copy Markdown
Collaborator

@code-yeongyu code-yeongyu commented May 4, 2026

Problem

claw skills show plan, claw skills describe plan, claw skills list plan, claw skills info plan were falling through to SkillSlashDispatch::Invoke, spawning real model sessions and consuming tokens.

claw skills show plan --output-format json     # → model session, $0.1381
claw skills help plan --output-format json     # → model session, $0.1381
claw skills describe plan --output-format json # → model session, $0.0280
claw skills info plan --output-format json     # → hung/killed
# session count 43 → 50 across four top-level session files

Root cause: classify_skills_slash_command had no guards for discovery prefixes — every non-reserved arg became Invoke("$<arg>").

Fix

  • Add "show" | "info" | "describe" as Local-only bare tokens
  • Add starts_with guards for "show ", "info ", "list ", "describe " → Local
  • handle_skills_slash_command + _json: filter skill list by name for show/info/describe, by substring for list — no model call, no session created

Test

skills_show_and_list_filter_do_not_invoke_model asserts all discovery patterns return Local, and bare skill names still dispatch to Invoke.

Pinpoints: ROADMAP #502, #503

`claw skills show <name>`, `claw skills info <name>`, and
`claw skills list <filter>` were all falling through to
SkillSlashDispatch::Invoke, which spawned a real model session,
consumed tokens, and created session files.

Root cause: classify_skills_slash_command had no guards for
these discovery prefixes; every non-reserved arg became Invoke.

Fix:
- Add "show", "info" as Local-only bare tokens
- Add starts_with guards for "show ", "info ", "list " args
- handle_skills_slash_command: filter skill list by name/substring
  for show/info/list-filter paths (no model call, no session)
- handle_skills_slash_command_json: same structured filtering

Test: skills_show_and_list_filter_do_not_invoke_model asserts
  classify_skills_slash_command returns Local for all discovery
  patterns and still returns Invoke for bare skill names.

Pinpoint: ROADMAP #502
@code-yeongyu code-yeongyu force-pushed the fix/skills-show-filter-no-invoke branch from e79b718 to 52f2ba6 Compare May 4, 2026 08:36
@code-yeongyu
Copy link
Copy Markdown
Collaborator Author

QA note: resumed_status_command_emits_structured_json_when_requested fails on this branch but this is a pre-existing failure on main — not introduced by this PR. The test expects exit 0 but gets exit 1 for --resume SESSION /status --output-format json. This is a main regression that needs fixing separately before these PRs can show clean CI on that specific test.

code-yeongyu added a commit that referenced this pull request May 4, 2026
resumed_status_command_emits_structured_json_when_requested was reading
the real ~/.claw/settings.json, causing loaded_config_files to be 1
instead of the expected 0 on machines with user config present.

Root cause: unlike other tests (e.g. resumed_config_command_loads_settings_files),
this test did not pass an isolated CLAW_CONFIG_HOME env var to run_claw,
so claw fell back to the real HOME and loaded the developer's settings file.

Fix: create a temp config-home dir and pass it as CLAW_CONFIG_HOME via
run_claw_with_env. This gives the assertion a clean 0-file baseline.

Unblocks PRs #2973, #2988, #2990 which all failed this same test on main.

Ref: ROADMAP #65
@code-yeongyu code-yeongyu merged commit 94b80a0 into main May 4, 2026
4 checks passed
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