Skip to content

Experiment with journal history prefix caching - #260

Open
Stephen Belanger (Qard) wants to merge 4 commits into
mainfrom
experiment/journal-history-prefixes
Open

Stephen Belanger (Qard) wants to merge 4 commits into
mainfrom
experiment/journal-history-prefixes

Conversation

@Qard

@Qard Stephen Belanger (Qard) commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Reduces repeated message-history storage in long coding-agent sessions while preserving complete histories for live processing and recovery.

The journal stores each event’s new messages alongside a file offset, prefix length, and checksum referencing an earlier record in the same session. Bounded fingerprint caches recognize shared prefixes and returning branches. Adaptive full checkpoints keep reconstruction chains manageable; cache misses store the complete history.

Live events retain their original payloads and flow directly into processing. Recovery reconstructs histories from the journal, validates backward references and record checksums, and parses record metadata into concrete types. Native payload contents remain opaque JSON. Both recovery caching and live queue budgeting account for expanded payloads. Reference targets become available only after their records are durably written.

Released journal formats remain readable. Older daemons reject the new versioned records. History hashing still costs CPU proportional to the incoming history size.

Validation: 23 journal/codec tests, codec coverage under alternate JSON features, the all-agent live/recovery span-equivalence matrix, formatting, and Clippy passed. Coverage includes branching, compaction, restarts, cache eviction, malformed records, native JSON depth limits, and interrupted writes.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T13:53:45.153499Z 48a9980 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Base automatically changed from t3/review-sdk-722-sdk-741 to main November 3, 2026 15:12
@Qard
Stephen Belanger (Qard) force-pushed the experiment/journal-history-prefixes branch from 48a9980 to c79402a Compare November 3, 2026 16:35
@Qard

Copy link
Copy Markdown
Collaborator Author

I'll probably hold off on landing this one for the moment until we've defined a more general spec for how to describe history evolution generically.

This branch has not been deployed

No deployments
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.

2 participants