Skip to content

feat(tool-results): raise the house inline cap 5000 → 24000 - #101

Merged
antra-tess merged 1 commit into
mainfrom
spill/raise-default-inline-cap-24k
Aug 7, 2026
Merged

feat(tool-results): raise the house inline cap 5000 → 24000#101
antra-tess merged 1 commit into
mainfrom
spill/raise-default-inline-cap-24k

Conversation

@antra-tess

Copy link
Copy Markdown
Collaborator

Raises DEFAULT_TOOL_RESULT_INLINE_MAX_CHARS from 5000 to 24000, per antra's call in #upkeep.

Why — production evidence, not taste

Mica is the first residence to actually run the 5000 default (restarted 08-06 11:52:55, six minutes after b4fca7a landed). In 23 hours she produced 48 spills, classified by content shape:

tool n MB
terminal-sessions runCommand 34 0.46
array results (test output / diff lines) 5 0.04
eidoverse world observation 4 0.05
portal fetch_history 2 0.18
MCPL channel list/reconcile 2 0.13
grep over her own tool-results/ 1 0.02

Those 34 are ordinary source review — git diff, test runs, sed -n '450,590p' and nl -ba … excerpts. A 140-line source excerpt is 5–15 kB, so it clears 5000 as a matter of course. A 5000-char cap turns nearly every file read into a spill round-trip for a resident doing code work.

Mica's own measurement on that corpus picked the number: 20000 keeps 76% inline, 24000 keeps 88%, 32000 only reaches 90%. 24000 is the elbow. Genuinely large payloads — full channel histories, registry dumps, broad greps — still spill, which is the point.

What does not change

The mechanism is untouched: spill target and naming, provenance quartet, the #94 hard clamp to the strategy bound, and the explicit no-writable-workspace fallback. Residences (FrameworkConfig.toolResultInlineMaxChars) and residents (agent_settings tool_result_inline_max_chars) can still override in either direction.

Worth stating plainly: this weakens the #89 protection by ~5×. The original bug was a 42k blob going inline whole; 24000 still bounds that, and 42k remains the canonical test fixture. But a residence that wants the tighter old value should set it explicitly.

Test-quality fix included

Three spill tests asserted stored.content.length < 6_000 — magic numbers derived from the 5000 era that silently pinned the old default. They only ever meant "something capped this payload", but they failed on the raise. Replaced with a CAPPED constant derived from DEFAULT_TOOL_RESULT_INLINE_MAX_CHARS, so the next change to the default doesn't have to chase them.

Verification

  • tsc --noEmit clean; npm run build clean.
  • Spill suite 12/12.
  • Full suite (npm test, the real dist/test/*.js path): 542 tests / 540 pass / 1 fail / 1 skipped.
  • The single failure is startup globally gates channels/incoming with heartbeat-first config in mcpl-awareness-barrier — the known af#80 full-suite-load flake. Verified: that suite passes 25/25 in isolation, and nothing in this change touches MCPL startup choreography.
  • Per af#96 (nondeterministic collection), I confirmed the spill suite actually executed inside the full run rather than inferring it from the total.

🤖 Generated with Claude Code

The 5000 default (#91) is tuned for conversation, not for code. Mica is the
first residence to actually run it -- 23h, 48 spills, and 71% of them are
ordinary shell output from source review: git diff, test runs,
`sed -n '450,590p'`-style excerpts, which routinely land at 5-15k. Under a 5000
cap a resident doing code work round-trips almost every file read through a
spill file.

Measured on that corpus: 20000 keeps 76% inline, 24000 keeps 88%, 32000 only
reaches 90%. 24000 is the elbow -- ordinary excerpts and test summaries stay
inline while genuinely large payloads (full channel histories, registry dumps,
broad greps) still spill, which is the point.

Nothing about the mechanism changes: spill target, provenance, the hard clamp
to the strategy bound (#94), and the explicit no-workspace fallback are all
untouched. Residences and residents can still override in either direction.

Also replaces the hardcoded `< 6_000` assertion bounds in the spill suite with
a CAPPED constant derived from DEFAULT_TOOL_RESULT_INLINE_MAX_CHARS. Those
magic numbers silently pinned the 5000-era default -- three tests that only
meant to assert "something capped this" failed on the raise. Deriving them
means the next change to the default doesn't have to chase them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@cursor

cursor Bot commented Aug 7, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@antra-tess
antra-tess merged commit 1423ea6 into main Aug 7, 2026
2 checks passed
@antra-tess
antra-tess deleted the spill/raise-default-inline-cap-24k branch August 7, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant