6 Commits

Author SHA1 Message Date
wassname 9e2c097782 fix: remove duplicate test 2026-04-10 20:43:42 +00:00
wassname a75f6b7ff7 fix: Infinity anchorTimestamp ghost block, prompt tag name, test cleanup
- resolveAnchorTimestamp returns endTimestamp + 1 instead of Infinity
- Validate timestamps are finite before creating blocks
- Skip corrupted blocks in overlap checks and compression application
- Include block timestamp range in overlap error messages
- Filter out corrupted blocks on session restore
- Fix prompt tag name: dcp-message-id → dcp-id to match injected tags
- Remove duplicate test, keep corrupted-block resilience test
2026-04-10 20:41:47 +00:00
wassname a0d9945830 fix: prevent Infinity anchorTimestamp ghost block spiral
The root cause of the compression spiral (101 failures, 2 hours):
resolveAnchorTimestamp returned Infinity when no message followed the
compression range. Infinity corrupted JSON serialization (became null),
and null timestamps in JS overlap checks coerced to 0, making every
range appear to overlap the ghost block b7.

Fixes:
- resolveAnchorTimestamp returns endTimestamp + 1 instead of Infinity
- Validate all timestamps are finite before creating a block (fail fast)
- Skip blocks with non-finite timestamps in overlap checks and compression
- Include existing block range in overlap error messages (diagnostic)
- Filter out corrupted blocks on session restore
- Guard synthetic message timestamp creation against non-finite values
- Add regression tests for Infinity anchor and null-timestamp blocks
2026-04-10 20:28:22 +00:00
Greg Harvell 8681bd833b fix: prevent orphaned tool_use/tool_result after compression with passthrough roles
Backward and forward expansion now skip PI-internal passthrough roles
(compaction, branch_summary, custom_message) when scanning for paired
assistant↔toolResult messages, ensuring atomic removal. Added a
post-compression repair safety net and deep-cloning to prevent content
mutation across context events.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 20:03:27 -04:00
Greg Harvell 24cf4e5b80 Bugfix for tool crash on compression 2026-03-30 17:30:53 -04:00
Greg Harvell e62d04dfe8 Fixing some errors and issues 2026-03-27 19:38:35 -04:00