Repository navigation
refactor(state): defer repository database opening until use - #145048
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 11, 2026, 12:08 PM ET / 16:08 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR delays opening the repository-workspace database until data access and reuses the transaction’s connection for internal reads. Merge readiness✅ Ready for maintainer review Keep open: this remains a useful, focused prerequisite for the accepted storage work, and neither current main nor the latest release includes it. No blocking defect was found. The previous contributor-proof blocker does not apply to the verified repository-admin author under this review’s rules. Priority: P2 Review scores
Verification
How this fits togetherRepository-workspace storage tracks cloud sessions’ repository identities and accepted checkpoints in shared SQLite state. Gateway callers use it to retrieve workspace records and locate checkpoint Git artifacts. flowchart TD
A[Gateway workspace caller] --> B[Store captures database path]
B --> C{Requested operation}
C -->|Artifact location| D[Return Git artifact path]
C -->|Read or write| E[Shared SQLite owner]
E --> F[Workspace record or committed update]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +9, Tests +36. Total +45 across 2 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep artifact-path resolution free of database side effects while retaining shared SQLite admission and exact-connection transactional reads. Do we have a high-confidence way to reproduce the issue? Not applicable as a reported runtime bug: this is a scoped lifecycle refactor; source confirms that current-main artifact-path lookup opens SQLite unnecessarily. Is this the best way to solve the issue? Yes: using the existing canonical path resolver and transaction owner is a narrow solution that preserves stored data and caller contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f99d468c1ecc. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* refactor(storage): run repository workspace SQL in workers Move repository reads and synchronous Kysely mutation kernels to the existing SQLite workers, and await their actual callers. Publish row changes from native commit receipts and retain operation custody through cleanup. Prepared repository facts serve synchronous authorization and event frames. Revalidate the original physical and logical session source at receipt and workspace grants, preserving full logical lookup and direct deletion's historical receipt rules. Remove the obsolete native-handle factory option. No storage schema, public configuration, permission or retention change. Current-main proof passes 80 focused SQLite/worker cases and owning types; qualified receiving adds 198 lifecycle/Gateway cases, all 27 test type graphs, and 66 repository/checkpoint/publication/file-RPC cases. Source controls reproduce foreign-write row and receipt loss, and the repaired paths pass. Independent review is clean through P2. Full build and affected receiving bundle checks pass with recorded source applicability. Completes the repository domain cutover after #145048 and #160858. * fix(gateway): bind prepared events to the current projection * fix(storage): finish committed repository artifact cleanup * fix(test): keep Gateway worker paths in canonical order * test(gateway): align prepared publication fixtures
…161124) * refactor(storage): run repository workspace SQL in workers Move repository reads and synchronous Kysely mutation kernels to the existing SQLite workers, and await their actual callers. Publish row changes from native commit receipts and retain operation custody through cleanup. Prepared repository facts serve synchronous authorization and event frames. Revalidate the original physical and logical session source at receipt and workspace grants, preserving full logical lookup and direct deletion's historical receipt rules. Remove the obsolete native-handle factory option. No storage schema, public configuration, permission or retention change. Current-main proof passes 80 focused SQLite/worker cases and owning types; qualified receiving adds 198 lifecycle/Gateway cases, all 27 test type graphs, and 66 repository/checkpoint/publication/file-RPC cases. Source controls reproduce foreign-write row and receipt loss, and the repaired paths pass. Independent review is clean through P2. Full build and affected receiving bundle checks pass with recorded source applicability. Completes the repository domain cutover after openclaw#145048 and openclaw#160858. * fix(gateway): bind prepared events to the current projection * fix(storage): finish committed repository artifact cleanup * fix(test): keep Gateway worker paths in canonical order * test(gateway): align prepared publication fixtures
Related: #144592
What Problem This Solves
Constructing a repository-workspace store opens SQLite even when the caller only needs an artifact path. Transaction helpers also reacquire their store through public read methods instead of using the connection already admitted to the transaction.
Why This Change Was Made
Capture the canonical absolute path without opening the database. Open on actual data access, retaining that captured path through environment changes and reopen. Reuse private native read helpers inside the existing transaction owner.
User Impact
Artifact-path planning no longer creates or reopens SQLite. Existing synchronous operations, revision checks, stored formats and artifact cleanup behavior remain unchanged.
Evidence