Repository navigation
test(cli): prove the catalog-budget escape hatch round-trips - #2595
Merged
Merged
Conversation
A skill past the run's catalog budget is reported `incomplete` with a message naming the command that verifies it on its own. That command was `--method skills/get --uri` — which, run as given, fetches the skill and checks nothing, so the advertised escape hatch produced no verdict. The message now names the whole runnable command, the skipped entry's own URI and `--verify` included. A CLI test hits the budget against the skills test server, lifts the command out of the report, runs it back through the real argument parser under the same budget, and asserts a verdict for that skill from files actually read. It fails against both the original text and a URI-without-`--verify` variant. Closes #2428 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: cliffhall <[email protected]>
2 tasks done
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The suggested command embeds a server-controlled URI without shell escaping, enabling command injection when pasted.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Fixes the CLI escape hatch for skills skipped by verification budgets.
Changes:
- Includes the skipped skill URI and
--verifyin guidance. - Adds CLI round-trip and core message assertions.
| File | Description |
|---|---|
core/mcp/skillsVerification.ts |
Builds the suggested verification command. |
clients/cli/__tests__/skills-verify-cli.test.ts |
Tests the command through the real CLI parser. |
clients/web/src/test/core/mcp/skillsVerification.test.ts |
Verifies per-skill command text. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
The budget message spliced `entry.uri` into a command users are meant to paste. The URI is server-controlled and shell metacharacters are legal in one, so a server could author a command that runs something else when pasted. Name a `<uri>` placeholder instead and point at the report's own `uri`; the round-trip test fills it in as one argv element, and the core test asserts the URI is never embedded. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: cliffhall <[email protected]>
Member
Author
|
Copilot round 1: one finding, fixed.
Re-checked after the fix: |
Member
Author
|
Copilot review loop closed. Round 2 was clean ("Approval recommended", no findings, nothing suppressed), and it marked round 1's shell-injection finding resolved. Stopping on the first clean round. |
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.

Closes #2428
What the test turned up
The budget-exceeded message told users to run
--method skills/get --urito get a verdict for a skipped skill. Run as given, that command fetches the skill and checks nothing: verification only happens under--verify(clients/cli/src/handlers/run-method.ts, theskills/getbranch). So the escape hatch the issue asked us to prove did not round-trip. It also left the URI blank, so the user had to look it up.Changes
core/mcp/skillsVerification.ts: the message now names the whole runnable command, with the skipped entry's own URI and--verify:`--method skills/get --uri skill://<path>/SKILL.md --verify`clients/cli/__tests__/skills-verify-cli.test.ts: a new end-to-end round-trip test against the in-process skills test server, with a catalog that setsskillCatalogMaxSkills: 1:skills/list --verifyskips every skill after the first for budget reasons.incompletetext.runCli, so the real argument parser) under the same budget.--verifyreport for exactly that URI, built from files actually read (files.length > 0) and without the budget message.clients/web/src/test/core/mcp/skillsVerification.test.ts: the existing core budget test now also asserts that each skipped report names its own URI plus--verify.Verified that the test catches the defect
I ran the new test against two mutated versions of the message:
--uriwith no value): fails--verify: fails, naming what the run printed instead (not a --verify report (exit 0): …)With the fix it passes.
Gate
local:validate(guards, format, lint, typecheck, every client build),verify:skills:cli,coverage:cli(447 tests),coverage:tui,coverage:launcher,verify:build-gate,verify:bundle-externals.coverage:webfailed on one test:inspectorClient-timeout-diagnostics.test.ts› "emits connectionDiagnosticsChange…", already tracked as Flaky integration test: inspectorClient-timeout-diagnostics 'emits connectionDiagnosticsChange' reads an undefined GET log entry #2580. It's a pre-existing flake and unrelated to this diff: in isolation it fails 5 of 6 runs with this PR's source change reverted, and 5 of 8 with it applied. Everything else incoverage:webpassed (8782 tests).NODE_USE_ENV_PROXY=1) breaks two proxy/transport integration suites locally (18 tests, same result with or without this change). The gate results above were run with the proxy variables unset, which matches CI.No UI change, so no screenshots.
🤖 Generated with Claude Code