v0.1.2
What changed
Fix: compress failed with no assigned ref when a range edge landed on a multi-tool-call assistant message.
Multi-tool-call assistant messages project to ${seq}#${callId} CoreMessage ids, so they carry no bare-${seq} ref — compress could never resolve them as range edges. This hit live sessions exactly where the nudge range table placed a multi-call message on a boundary.
Fix (two planes)
region.ts—resolveSurfaceRangenow requires a boundary to be both tool-pairing-balanced and plain-ref (hasPlainRef). Multi-call edges shift inward to the nearest clean cut (shrink-first), or expand outward to the enclosing clean pair when shrinking collapses.tools.ts—handleCompressbalances edges throughresolveSurfaceRangebefore resolving refs.
Live verification (closed loop)
compress 106754..143714failed before the fix (no assigned ref)compress 106756..143714→ block99597a3a, 80 messages, ~24,567 tokens reclaimed;search_context+acp_statusconfirm the durable loop- Session ledger: 4 blocks, ~183K tokens compressed total
Tests
32/32 green (typecheck + build clean): new appendMultiToolCall fixture, region-level boundary tests, end-to-end compress tests (lone multi-call boundary expands to its round; multi-call messages inside a clean range shadow normally; nudge range-table edges compress successfully).
Commits: ea24a7e (fix) · 24959ab (release v0.1.2)