Skip to content

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

Merged
thymikee merged 1 commit into
callstack:mainfrom
strzhao:fix/press-mcp-budget
Nov 16, 2026
Merged

thymikee merged 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
@strzhao

strzhao commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Both smoke jobs (ios/macos) and the full check suite are green at 0bb051e now — 12 success, the 2 skips are conditional jobs (matrix / Bundle Size). Ready for merge from our side.

On the two copy notes: left as-is since they're non-blocking; happy to restore the "repeats allowed" phrasing with a matching cut if you want that rule visible at the MCP surface.

@thymikee
thymikee merged commit 1895704 into callstack:main Nov 16, 2026
14 checks passed
thymikee added a commit that referenced this pull request Nov 16, 2026
* origin/main:
  fix(alert): derive the request envelope from an alert wait window (#4581)
  fix(android): require a nonzero chunk before a recorder counts as ready (#4559)
  chore(deps): clear astro and node-forge security alerts (#4577)
  fix(ios): establish the screen origin of a full-screen private AX root (#4573)
  docs(agents): trace behavior claims during review (#4576)
  fix(mcp): trim the press plan text back under the always-loaded byte budget (#4572)
  refactor(alert): one helper owns the alert runner budget (#4563)
  feat(interaction): multi-ref press plan lowered through the ordinary press lane (#4296)
  fix(ios): use the caller's budget for alert get and type the watchdog outcome (#4540)
  feat(recovery): bound remote health and runner-busy recovery by the command's deadline (#4541)
  fix(ios): find the navigation bar back button outside the bar's subtree (#4542)
  feat(open): report device kind, model and osVersion on open and session identity (#4543)
  fix(apple): use typed screenshot timeouts and observed shutdown recovery (#4544)
  feat(device-status): report per device whether a new session can take it (#4547)
  fix(runner): type the refusals for a control the target cannot supply (#4548)
  refactor(transport): share outgoing transfer phase ownership (#4551)
  fix(remote): bound artifact preparation and upload phases (#4552)
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