Repository navigation
refactor(sessions): separate transcript read owners - #149670
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 1:34 AM ET / 05:34 UTC (Revision 3). ClawSweeper reviewWhat this changesSeparates transcript queries and archive readers from database acquisition and message display decoration while preserving existing chat-history behavior. Merge readiness✅ Ready for maintainer review Keep open: this remains a useful, maintainer-sponsored prerequisite for history-reader isolation. No actionable introduced defect was found, and the cited hosted CI passed on the reviewed head. Priority: P3 Review scores
Verification
How this fits togetherGateway history requests read stored conversations from SQLite or transcript archives, then project those records into client-visible messages. This change separates the storage readers from lifecycle management and display decoration. flowchart TD
A[History request] --> B[Resolve transcript target]
B --> C[Database acquisition]
C --> D[SQLite snapshot readers]
B --> E[Archive reader]
D --> F[Stored message projection]
E --> F
F --> G[Display decoration and response]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +105, Tests +30, Other -2. Total +133 across 33 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one canonical implementation of each transcript reader, with acquisition and reconciliation outside the query modules and native performance claims reserved for the composed integration. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR addresses module coupling rather than a reported runtime defect; source comparison confirms that coupling remains on fetched main. Is this the best way to solve the issue? Yes: extracting the existing implementations and migrating their callers is a narrow way to establish independent read modules without changing storage or public contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against db1d5d2dccbc. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Merged via squash.
|
* refactor(history): isolate read-only storage owners * refactor(history): use guarded transcript records
Related: #143610
What Problem This Solves
Cold chat-history reads share module entry points with projection maintenance and general session-file operations, preventing the read-only query path from being loaded independently.
User Impact
Internal prerequisite for history-worker isolation. This preserves current behavior and requires no schema migration or operator action. Native cold-history latency remains to be validated with the worker integration.
Why This Change Was Made
Extract the canonical SQLite history, projection, and raw-delta readers, plus transcript-message and archive readers. Migrate callers while preserving normalization, validation, ordering, read fences, errors, and cleanup. Store acquisition and reconciliation remain with their existing owners.
Reuse the existing record guard and remove two obsolete assertion-baseline allowances. Production: +1,755/-1,650 (net +105), justified by explicit database-bound read APIs. Tests: +38/-8; baseline: -2. Existing query and cache implementations retain one owner.
Evidence
Current integrated head:
2c12a1c1f2e096f4c0ab5a6e63c622e430e5072c, treeb3d582d25cfe68ce0d486af12111ac48d48cab7a.Merged frozen main
b6bbf1f5215a68f91c0e55eb2783ecbd9703db16. The import-only conflict resolution preserves main's question-answer custody checks and compiled history-count readers, together with the read-only SQLite owner boundary. Targeted formatting, diff checks, and independent resolution review passed. Fresh full integrated-branch review found no actionable P0–P2 findings.Prior source
8d5a64e306586955bd5b0318d31ac0367be6cf7dpassed 37 focused runtime files / 635 tests, all 6 import-boundary cases, all 31 changed gates, and a privateqaRuntimebuild with matching source-carrier stamps. Its emitted relative-import inventory resolved. These results are retained in a private complete capture; the associated runner-allocation workflow does not independently expose that command proof. They do not qualify the integrated head or establish latency.Current-head hosted CI passed: 195 successful jobs and 6 intentional skips, including the required aggregate, build, type, and runtime checks. The runtime-config shard passed 368 files / 5,732 tests, including all 9 incoming question-answer custody cases, all 3 history-count/cache cases, and all 6 import-boundary cases. The single Windows-job retry and its dependent aggregate passed on unchanged source; the other 199 job results carry forward from attempt 1. Both previously failing native argv-lookup cases passed; the initial failure's cause remains unknown.
After the ready transition, normal PR CI also passed: 124 successful jobs and 16 skips, including its required aggregate. This run tested GitHub merge commit
bec38bb6befb94819a8d5970b2660c8475006027, treeb797228f0f7c582834d77699a78d885d55985730, combining source2c12a1c1f2e096f4c0ab5a6e63c622e430e5072cwith main92e81af8ba60aa49c560e066753d52dad2893b73. This merge-result proof is separate from the direct-source release-gate run above.The iOS/macOS stack still requires composed native cold-history proof. No measured latency claim.