Repository navigation
Fix compressed and archived history segment recovery - #4
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a840cda281
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if old and old['identity'] != identity: | ||
| if compressed or old['identity'].startswith('zstd:'): | ||
| # Representation changes restart bounded indexing; refs retain | ||
| # logical paths and uncompressed byte offsets for lazy checks. | ||
| old = None |
There was a problem hiding this comment.
Reject changed compressed contents before retaining stale events
When an existing .zst file is replaced or recompressed with different contents, its identity changes and this branch resets only the source progress row; it does not remove events previously contributed by that logical path. After reindexing, records removed from the replacement remain visible in events, while opening their details fails with Indexed source record changed. Either distinguish a plain/compressed representation transition from a changed compressed source or rebuild the affected cached events rather than merging the replacement into the old index.
Useful? React with 👍 / 👎.
| archive = Path(sessions).parent / 'archived_sessions' / path.name | ||
| if archive != path: | ||
| yield archive | ||
| yield Path(str(archive) + '.zst') |
There was a problem hiding this comment.
Report timestamps from resolved segment paths
When the logical file has been compressed or moved into archived_sessions, these candidates allow indexing from the physical replacement, but _snapshot still computes source_updated by statting the absent logical paths at history.py:426. Consequently a chat whose segments exist only in either newly supported representation reports 1970-01-01T00:00:00+00:00 as its latest source update; retain or re-resolve the physical path when calculating that value.
Useful? React with 👍 / 👎.
Summary
.jsonlbecomes.jsonl.zstor moves intoarchived_sessions.Validation
9c53535: Ubuntu/macOS x Python 3.10/3.13/3.14 all six jobs passed (push and PR workflows).py_compileandgit diff --checkpassed.Resource boundary
No decoded transcript files are written. Compressed indexing uses bounded forward chunks and an 8 MiB decoder window. Input work also has a byte cap and cooperative deadline. Explicit details scan at most 16 MiB per reference and show a limit notice beyond that; summaries remain browsable. Python 3.10-3.13 needs optional
backports.zstd; Python 3.14 uses its standard library.Installed files and already-running observers are separate: activation requires restarting the observer and obtaining fresh private links; this PR does not change hooks or global rules.