Skip to content

fix(mcp): trim the press plan text back under the always-loaded byte budget - #4572

Open
strzhao wants to merge 1 commit into
callstack:mainfrom
strzhao:fix/press-mcp-budget
Open

strzhao wants to merge 1 commit into
callstack:mainfrom
strzhao:fix/press-mcp-budget

Conversation

@strzhao

@strzhao strzhao commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Fixes the command-tools-loading-meta byte-budget failure introduced on main by #4296.

What broke

feat(mcp)!: preload loop tools, trim schemas, and shorten errors (d78be6c) set an ALWAYS_LOADED_BUDGET_BYTES = 22 KiB guard on the tool JSON that lands in every run's first prompt. The multi-ref plan merge (#4296) grew the press tool description (+407 B of plan-contract text) and the intervalMs field copy (+73 B), which — combined with the same-day back description growth from the maintainer's 19:41Z push — pushed the set from 22060 B (budget headroom 468 B) to 22862 B on CI: the test has been red on main since the #4296 merge push (20:28Z) through 21:11Z, the latest head.

Measured attribution (local, per-sha, clean install)

sha TOTAL press state
d78be6c (budget set) 22060 3373 green, 468 B margin
89485f9 (pre-#4296) 22396 3373 green, 132 B margin (maintainer back +336 ate most of it)
82819f8 (#4296 merge) 22854+8 env 3831 over by 326 local / 334 CI
this fix 22498 3475 green, ~22-30 B margin

The fix

The long plan contract already lives in docs/commands.md (the ADR 0014 section) — the MCP description keeps the semantic minimum: comma-separated ref list, 2-16 keys in order as one command, admitted before the first press. intervalMs returns to its pre-plan wording (the generic repeated-action delay text already covers ref sequences). No behavior change, no budget bump — the maintainer's trim-first approach (d78be6c) is the precedent this follows.

Verification

  • src/mcp/__tests__/command-tools-loading-meta.test.ts: 5/5 pass
  • src/mcp/: 28 files / 232 tests pass
  • packages/command-surface/src/interaction/: 4 files / 26 tests pass
  • packages/command-runtime/src/commands/interaction/ + packages/command-registry/src/: 85 files / 561 tests pass

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff

…budget

callstack#4296 grew the press tool description and the intervalMs field copy by ~400
bytes, which pushed the always-loaded tool set over the 22 KiB first-prompt
budget the loading-meta test guards (22862 bytes > 22528 on CI). The long
plan contract already lives in docs/commands.md and the ADR; the MCP
description keeps the semantic minimum (comma-separated ref list, 2-16 keys,
one command, admitted before the first press) and intervalMs returns to its
pre-plan wording.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

You’re at about 95% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

View guided diff | Re-trigger cubic

@thymikee

Copy link
Copy Markdown
Member

This is ready from a code review at 0bb051e: the diff only trims two description strings in packages/command-surface, and I found nothing that blocks it. The two smoke jobs (ios and macos) were still running when I looked, so they need to finish green, along with the budget test, before merge. The remaining margin is about 22 bytes. Not blocking, and you can take or leave these: the press description is the only place an MCP agent learns that press takes a ref list, and the trim drops that a repeated ref is allowed (for example PIN digits like @e12,@e13,@e12,@e13), so restoring something like "repeats allowed" and paying for it with a matching cut elsewhere would keep that rule visible; the intervalMs response schema at index.ts:219 still has the "between the keys of a comma-separated ref sequence" clause that the input field lost, so the two copies now disagree; and the budget test at command-tools-loading-meta.test.ts:49 could print per-tool byte sizes on failure, since the next overrun will need manual bisecting with only about 22 B of room.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 16, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants