Skip to content

Sync context estimates incrementally from turn identities - #555

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-6911-syncfromturns-walks-the-full-history-on-every-reactor-event
Aug 23, 2026
Merged

Sync context estimates incrementally from turn identities#555
TheGreatAxios merged 3 commits into
mainfrom
cl-6911-syncfromturns-walks-the-full-history-on-every-reactor-event

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Context estimates cache prefix turn identities and add only new turns on append instead of walking the full history on every reactor event.
  • Compaction rewrites, shrinks, and same-length middle identity breaks still fully recompute so image-aging cannot leave a stale total. Compaction arming is unchanged.

Verification

  • bun run typecheck, bun run build, and bun run test pass
  • Context-estimate tests cover append, no-op, shrink/rewrite, and same-length middle identity break

Fixes CL-6911

Walking the full history on every reactor event is wasteful. Cache prefix
turn refs and add only the suffix when identities hold. Rewrite, shrink,
or a middle identity break still fully recomputes so image-aging cannot
leave a stale total.
@linear-code

linear-code Bot commented Aug 23, 2026

Copy link
Copy Markdown

CL-6911

@TheGreatAxios
TheGreatAxios merged commit ff5b21d into main Aug 23, 2026
5 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