Skip to content

fix(skills): name each client's own catalog-budget remedies - #2698

Merged
cliffhall merged 3 commits into
v2/mainfrom
v2/fix/2633-skills-budget-hint-per-client
Oct 12, 2026
Merged

cliffhall merged 3 commits into
v2/mainfrom
v2/fix/2633-skills-budget-hint-per-client

Conversation

@cliffhall

Copy link
Copy Markdown
Member

Closes #2633

Problem

When --verify / verify-all hits the skills catalog budget, the incomplete message was hard-coded in core/mcp/skillsVerification.ts with the web's "raise it in the server's Skills settings" and the one-shot CLI's --method skills/get --uri <uri> --verify — in every client. mcpdo and the TUI have neither.

Change

  • verifySkills takes a SkillBudgetHint (raise + verifyOne clauses). The walk still owns the sentence. Each caller supplies the two remedies. With no hint it falls back to DEFAULT_SKILL_BUDGET_HINT, which names no client, so a new caller can't pick up another client's commands by accident.
  • One-shot CLI (CLI_SKILL_BUDGET_HINT, in core/cli/handlers/skills-verify.ts): raise with --skill-catalog-max-skills / --skill-catalog-max-bytes or the server's skillCatalogMaxSkills / skillCatalogMaxBytes, and verify with `--method skills/get --uri <uri> --verify`. The command is the same as before, so the Skills-verification budget-exceeded message names a --method skills/get --uri escape hatch with no test asserting it round-trips #2428 round-trip test still covers it.
  • mcpdo (MCPDO_SKILL_BUDGET_HINT): raise with skillCatalogMaxSkills / skillCatalogMaxBytes in the connection's catalog entry, and verify with `mcpdo @<conn> skills/get <uri> --verify`. runMethod gains an optional third RunMethodOptions argument, which defaults to the CLI hint. The daemon passes mcpdo's hint at all three runMethod sites. The hint is kept out of MethodArgs on purpose: mcpdo builds those from caller-sent RPC params.
  • TUI (SkillsTab): raise with --skill-catalog-max-skills / --skill-catalog-max-bytes at launch, and verify a single skill by selecting it and pressing Enter.
  • The skill URI is still never spliced into a command; each command uses the <uri> placeholder.

Tests

  • clients/mcpdo/__tests__/skills-budget-hint.test.ts (new) runs end to end against an HTTP skills server with skillCatalogMaxSkills: 1. It checks that mcpdo's remedies appear and the CLI/web ones don't. It then runs the suggested mcpdo @<conn> skills/get <uri> --verify back through mcpdo and gets a full verdict for the skipped skill.
  • Core: the default hint is client-neutral, and a caller-supplied hint replaces it.
  • CLI: the existing Skills-verification budget-exceeded message names a --method skills/get --uri escape hatch with no test asserting it round-trips #2428 round-trip now also asserts the --skill-catalog-max-* remedy.
  • TUI: the verify-all budget test asserts the pane's own remedies and the absence of --method.

npm run local:gate passed.

TUI output

The only TUI change is this message text. Here is the rendered frame from the SkillsTab test, for a skill past a budget of one:

│ Incomplete:
│   Not read: this run already reached its catalog budget of 1 skills / 67108864
│   bytes (raise it with --skill-catalog-max-skills / --skill-catalog-max-bytes at
│   launch). Nothing about this skill's files has been checked — verify it on its
│   own by selecting it and pressing Enter to get a verdict.

🤖 Generated with Claude Code

The incomplete message for a skill past the run's catalog budget was
hard-coded in core with the web's "Skills settings" and the one-shot CLI's
`--method skills/get --uri <uri> --verify`, so mcpdo and the TUI sent their
users to a setting and a command that do not exist there.

verifySkills now takes a SkillBudgetHint (where to raise the budget, how to
verify one skill alone), defaulting to client-neutral text. The one-shot CLI
names --skill-catalog-max-*; mcpdo (via a new runMethod options argument the
daemon passes) names the catalog entry and `mcpdo @<conn> skills/get <uri>
--verify`; the TUI names its launch flags and Enter.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: cliffhall <[email protected]>
@cliffhall cliffhall added the v2 Issues and PRs for v2 label Oct 12, 2026
@cliffhall
cliffhall requested a balanced review from Copilot October 12, 2026 19:06

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.

🟡 Changes recommended

The new mcpdo test’s 20-second inner timeouts exceed its 15-second enclosing test timeout.

1 open finding
What changed in this PR

Adds client-specific guidance when skill verification exceeds catalog budgets.

Changes:

  • Introduces configurable budget-remedy hints.
  • Supplies tailored CLI, mcpdo, and TUI instructions.
  • Adds unit and end-to-end coverage.
File Description
core/​mcp/​skillsVerification.ts Adds customizable budget hints.
core/​cli/​handlers/​skills-verify.ts Defines CLI and mcpdo hints.
core/​cli/​handlers/​run-method.ts Passes hints into verification.
clients/​web/​src/​test/​core/​mcp/​skillsVerification.test.ts Tests default and custom hints.
clients/​tui/​src/​components/​SkillsTab.tsx Adds TUI-specific remedies.
clients/​tui/​__tests__/​SkillsTab.test.tsx Verifies TUI messaging.
clients/​mcpdo/​src/​daemon/​server.ts Supplies mcpdo hints to shared dispatch.
clients/​mcpdo/​__tests__/​skills-budget-hint.test.ts Tests mcpdo guidance end to end.
clients/​cli/​__tests__/​skills-verify-cli.test.ts Extends CLI remedy coverage.

🧠 Review effort: Balanced

…mand budgets (#2633)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: cliffhall <[email protected]>
@cliffhall

Copy link
Copy Markdown
Member Author

Copilot round 1: one finding (the mcpdo test's 20s command timers were inside Vitest's 15s default). Fixed in 50a057b with an explicit outer test timeout above the three command budgets, and replied in the thread. No suppressed comments. Requesting round 2.

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.

🔵 Needs a closer look

The new mcpdo test can delete its daemon directory before asynchronous shutdown completes.

0 open findings

1 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Medium severity Wait for daemon shutdown before removing its directory

clients/​mcpdo/​__tests__/​skills-budget-hint.test.ts:67

daemon/stop only queues shutdown and returns its response before stop() finishes (clients/mcpdo/src/daemon/server.ts:534-537). Removing the directory immediately can therefore race a still-running daemon and leave it alive across tests. Wait for the socket to disappear before deleting the directory, as the other spawned-daemon suites do.

🧠 Review effort: Balanced

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.

🟢 Approval recommended

The client-specific guidance is correctly propagated and covered by focused regression tests.

0 open findings

🧠 Review effort: Balanced

@cliffhall
cliffhall merged commit fd5659f into v2/main Oct 12, 2026
8 checks passed
@cliffhall
cliffhall deleted the v2/fix/2633-skills-budget-hint-per-client branch October 12, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Issues and PRs for v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Skills catalog-budget message names web/CLI remedies in mcpdo and the TUI

2 participants