schema byte-budget: ~14KB of tool-description growth crept in under stale measurements #407
Labels
No labels
breaking
bug
documentation
enhancement
epic
good first issue
help wanted
refactoring
resolution/duplicate
resolution/invalid
resolution/wontfix
security
severity/critical
severity/high
severity/low
severity/medium
status/abandoned
status/blocked
status/needs-decision
status/needs-info
status/needs-verification
testing
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sixfold-space/madtea#407
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found while landing #375 and #387.
What happened
totalToolByteBudget(internal/mcp/schema_budget_test.go) caps the serialized size of the whole tools/list payload. The cap forces verbose tool text intomadt_helptopics instead of the always-shipped schema. Every byte of MCP description costs tokens on every client connect.Since the last pin (recorded at 215485), main-line description growth added up: the ssh surfaces, the loud what/why/action git messaging, and the finish/commit/whoami additions. The measured total reached ~229948 under go-sdk v1.6.1. That is ~14.4KB of growth. All of it sits inside the per-tool caps, so the guard never fired. It crept to ~52 bytes under the old 230000 cap while the recorded comment still claimed ~14.5KB of headroom.
Two small additions then tipped it over: protect_set (#375, ~196 bytes) and the go-sdk v1.7.0 always-emitted hint keys (#387, ~1.5KB). I recalibrated the budget to 240000 and refreshed the measurement comments.
The question
The guard's whole job is to keep the always-shipped surface lean, and it silently lost ~14KB. Three paths are open:
Where I lean
I lean toward the diet pass plus the discipline check. The guard exists to keep the always-shipped surface lean, and it lost ~14KB with no signal. But the verbosity came from real usability work, mainly the loud git messaging, so whether it earns its token cost needs a closer look before I cut.
Related: #375, #387.
Decided: diet + discipline.
madt_helpsplit. Savings come only from real redundancy.internal/mcp/schema_budget_test.goare hand-maintained with no guard.Clearing needs-decision.