Repository navigation
fix(sessions): release writer lane during transcript archival - #119460
fuller-stack-dev merged 1 commit into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 5, 2026, 12:14 AM ET / 04:14 UTC. ClawSweeper reviewWhat this changesThis PR changes SQLite session archival to plan under the writer lane, materialize the archive outside it, then reacquire and validate before deleting persisted transcript state. Merge readinessKeep open: current main still holds the per-store writer during archive materialization, while this branch releases it and revalidates authoritative state before deletion. The patch appears correct; its maintainer/protected status requires the normal exact-head refresh before merge. Priority: P1 Review scores
Verification
How this fits togetherSQLite lifecycle maintenance archives session transcripts before reclaiming their rows, while Gateway session writes serialize through a per-store writer lane. This change separates slow archive construction from the final state-changing transaction so unrelated writes can continue. flowchart LR
A[Lifecycle cleanup or eviction] --> B[Plan under store writer]
B --> C[Worker builds archive]
C --> D[Revalidate under store writer]
D --> E[Delete transcript and session rows]
F[Concurrent session write] --> G[Store writer lane]
G --> D
Before merge
Agent review detailsSecurityNone. PR surfaceSource +59, Tests +207. Total +266 across 4 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land one canonical plan → materialize → revalidate-and-delete flow across lifecycle cleanup, bulk mutation, deleted-agent purge, and disk-budget eviction. Do we have a high-confidence way to reproduce the issue? Yes, from source and supplied proof: current main awaits archive materialization inside the writer lane, and the branch's gated race tests exercise same-store writer progress while archival is paused. Is this the best way to solve the issue? Yes. Reusing the established post-writer finalizer and retaining final snapshot/reference/admission validation is the narrowest owner-boundary repair; moving the work to callers or adding a fallback would duplicate policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c925634ae83b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(sessions): release writer lane during transcript archival This is item 1/1 in the current shard. Shard 10/16. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Maintainer exact-head refresh complete for ClawSweeper rank-up moves checked:
Required CI is green ( |
|
Merged via squash.
|
(cherry picked from commit 141a16f)
…ion generations (#128980) * fix(sessions): keep gateway responsive while large transcript archives are built (#112424) * fix(sessions): keep gateway responsive during transcript archiving * test(sessions): strengthen archive worker coverage * fix(sessions): bound archive worker concurrency * test(sessions): normalize rollback paths on Windows * fix(sessions): load source archive worker on node 22 * fix(sessions): align archive fencing with session windows * test(sessions): adapt cleanup race to archive worker * fix(sessions): harden archive worker lifecycle * style(sessions): format archive lifecycle tests * fix(sessions): release writer lane during archive work --------- Co-authored-by: Josh Lehman <[email protected]> (cherry picked from commit 9bfe292) * fix(sessions): release writer lane during transcript archival (#119460) (cherry picked from commit 141a16f) * fix(gateway): fence background titles during session archival Backport the session-title admission fix from upstream commit 530b33e (#123608) without its unrelated gateway changes. Keep asynchronous disk-budget scans out of the transcript stat regression fixture. * test(ui): settle custodian mobile layout assertions (#116613) (cherry picked from commit 871abad) --------- Co-authored-by: Heming Zeng <[email protected]> Co-authored-by: Josh Lehman <[email protected]> Co-authored-by: Jason (Json) <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
Related: #112423
Follow-up to #112424
What Problem This Solves
Fixes an issue where SQLite session cleanup, lifecycle mutation, deleted-agent purge, or disk-budget eviction could keep the per-store writer lane occupied while a transcript archive was built. A newly arriving write to the same store then waited for archive materialization even though the CPU-heavy archive work already ran in a Worker.
Why This Change Was Made
Archive callers now plan under a short SQLite writer section, release the writer while the archive is materialized, then reacquire it and revalidate authoritative rows, references, and admission state before deleting. Maintenance archival follows the same boundary.
This preserves extract-before-delete and lifecycle invalidation without polling, retries, request-time caches, fallback readers, config, or protocol changes.
User Impact
Same-store session writes can continue while low-priority transcript archival is pending. Archive correctness, shared-generation protection, and disk-budget behavior are preserved.
This PR does not claim to fix cold
chat.metadatapreparation. A proof-only cold metadata probe exceeded 2 seconds while writer andsystem-presenceresponsiveness passed, so that remains a separate lifecycle/catalog investigation.Evidence
tbx_01kz7hgs8vy7qx6h9cggbjhm5z, Actions run30959924647.sessions.patchand unrelatedsystem-presenceRPCs remained below 500 ms; the archive byte length and SHA-256 matched, and session, transcript, FTS, and window rows were removed.tbx_01kz7yxwa13gxb9dpxck25sfsy, Actions run30971926178.pnpm check:changedpassed forcore, coreTestson the reviewed diff.run_505553e9541eandrun_261a03a9e071; no AWS result is claimed.AI-assisted: yes. I reviewed the ownership boundaries, competing hypotheses, final diff, and validation results.