Skip to content

fix(runtime): preserve compaction projection after overflow - #2602

Merged
likun666661 merged 2 commits into
apache:mainfrom
likun666661:fix/compaction-durable-projection
Aug 9, 2026
Merged

likun666661 merged 2 commits into
apache:mainfrom
likun666661:fix/compaction-durable-projection

Conversation

@likun666661

Copy link
Copy Markdown
Member

Summary

  • allow reactive step-0 context overflow recovery to compact prior history as a pre-turn checkpoint while preserving the current user anchor verbatim
  • pin checkpoints accepted during an active send and rebuild every later provider request from the raw durable ledger through that checkpoint boundary
  • fail closed on checkpoint/source mismatches so compacted raw history cannot silently reappear
  • add regression coverage for overflow -> compact retry -> tool call -> successor request

Why

The reactive compactor previously required a safe span after the current user anchor. At step 0 no such event exists, so recovery failed with no_safe_completed_span even when prior history was foldable. When recovery did succeed later, its compacted messages only applied to the immediate retry; a following tool step rebuilt from the cached prior replay and could resurrect the raw covered span.

Testing

  • npm --workspace @maka/runtime run typecheck
  • Biome lint on the five changed files
  • 74 related tests across overflow recovery, mid-turn compaction, and history checkpoint replay

@likun666661
likun666661 marked this pull request as ready for review August 9, 2026 12:17
@likun666661
likun666661 merged commit 808c082 into apache:main Aug 9, 2026
9 checks passed
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