Repository navigation
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: blocked before merge. Reviewed September 15, 2026, 2:42 PM ET / 18:42 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR lets unused agents pass session-migration readiness checks when their legacy index is empty, while preserving checks for historical transcripts and existing import receipts. Merge readiness⛔ Blocked before merge - 1 item remains The fix remains necessary on inspected main. Both prior P1 findings are resolved, the narrowed behavior matches the recorded maintainer decision, and no remaining actionable defect was found. Priority: P2 Review scores
Verification
How this fits togetherDoctor imports legacy session files into each agent’s SQLite database and retains originals needed by unavailable plugins. Gateway startup checks those files and import receipts before serving session history. flowchart TD
A[Legacy session index] --> B[Startup migration check]
C[Deferred plugin migrations] --> B
D[Database and import receipt] --> B
E[Historical transcripts] --> B
B -->|Empty unused owner| F[Allow startup]
B -->|History needs import| G[Doctor import and verification]
G --> B
Before merge
Agent review detailsSecurityNone. PR surfaceSource +20, Tests +113. Total +133 across 4 files. View PR surface stats
Review metricsNone. 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. Technical reviewBest possible solution: Keep the narrow startup exemption and shared transcript scan, with Doctor remaining the sole importer and retained-source identity checks intact. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source establishes the incompatible receipt requirements, and the discussion records a failing real-state reproduction; this read-only review did not execute it. Is this the best way to solve the issue? Yes. The narrowed exemption repairs the existing owner’s readiness decision without changing schemas, settings, import ownership, or receipt validation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e7dde047904e. 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)
|
|
Maintainer review (landing run stopped before merge). The deadlock you describe in #149263 is real and this is the right place to fix it, but the exemption as written is wider than the case that has nothing to lose. Reproduced against the real-state fixture in
Accepted narrower rule: skip the receipt demand for a deferred owner only when all three hold: the source index has zero entries, the owner has no database, and the owner has neither unindexed history in the source dir nor an existing receipt. Any receipt that exists keeps its identity validation; any history keeps the demand. Please also add the two cases above as regressions next to your no-database case (they should fail on this head and pass after). Everything else in the PR is right: the invariant comment, the real-entry-point regression, and the scope. I will land it as soon as those are in; if you would rather I take it over, say so and I will keep your authorship. |
19b6833 to
812fe61
Compare
|
I pushed narrowing commit Both new regressions failed on the original PR head because startup did not throw, then passed after the fix. The original unused-owner regression still passes. Thanks for identifying and fixing the unused-agent startup loop. |
|
Merged via squash.
|
…base (openclaw#149260) Fix the Gateway startup and Doctor deadlock introduced by openclaw#148901 when an empty legacy session index belongs to a deferred plugin owner without a database. Keep the contributor's unused-owner fix and the maintainer narrowing: exempt only an empty index with no database, no receipt, and no unindexed transcript history. Validate existing receipts first and share the transcript-directory scan with Doctor discovery, preserving the migration barrier for historical sessions and missing imported databases. Regression coverage exercises the real startup assertion and Doctor import with temporary state and SQLite, including both admission failures found during review. Fixes openclaw#149263. Co-authored-by: Peter Steinberger <[email protected]>
Fixes #149263.
What Problem This Solves
#148901 tightened the deferred-plugin session migration gates: startup now requires a sha256-bound verified-import receipt from every roster owner of an empty legacy session index, while Doctor only issues that receipt when the owner already has a session database (the new
verifiedImportgate indoctor-session-sqlite.ts, which deliberately "must never create a database solely for an unused shared-index owner").For a configured-but-unused agent — an empty legacy
sessions.json({}), a deferred plugin session migration pending, and no SQLite database yet — the two gates deadlock each other:SessionStoreMigrationRequiredError: Legacy session store requires migration: ... Run "openclaw doctor --fix" ...openclaw doctor --fixruns, imports zero records, and (by design) refuses to create a database just to hold the receipt — so no receipt is ever issuedA receipt could never be valid for such an owner anyway: receipts bind the database identity, which a later-created database would invalidate. And a zero-record source has nothing to replay.
Why This Change Was Made
Startup exempts an owner only when its legacy index is empty, its database is absent, no verified import receipt exists, and the source directory has no unindexed transcript history. Doctor and startup share the transcript-directory scan in
legacy-store-inspection.ts.The maintainer narrowing validates existing receipts before considering the exemption. Existing databases still require verified receipts; unindexed history still requires Doctor import; a missing previously imported database still fails identity validation. Original sources remain available for deferred plugin migration.
User Impact
sessions.jsonand a pending deferred plugin session migration no longer deadlocks Gateway startup /openclaw updatebehind an unactionable "runopenclaw doctor --fix" loop.Evidence
Maintainer narrowing: the final exemption applies only to an empty source index whose owner has no database, no unindexed history in the source directory, and no existing receipt. Startup reuses Doctor's extracted transcript-directory scan and reads existing receipts through their full identity validation before considering the exemption. Two new regressions beside the original unused-owner case cover (1) unindexed history requiring Doctor import before startup succeeds and (2) a removed receipt database failing with the existing
ENOENT/lstatidentity error. Both failed on contributor head19b68333b724064741a770ff665ccf3af6cd1fd2because startup did not throw, then passed with the narrowing; the original unused-owner test still passes. The focused run passed 54 tests before and after rebasing onto current main across deferred-plugin imports, historical discovery, and startup maintenance. The contributor's commit and authorship remain intact, with the narrowing in a separate maintainer commit.node scripts/check-changed.mjspassed for all four touched files, including core/test typechecks and lint; no nested-worktree fallback was needed. Branch autoreview againstorigin/mainis scoped-clean at P1 on812fe61b598bb1723e24c5bbce7ceef772aeca1a.Red/green through the real entry points — no mocks; real temporary state directories and real SQLite via
withOpenClawTestState, drivingrunDoctorSessionSqliteandassertSessionStoreMigrationCompletedirectly.Before fix (main @
8072377b735, red)New regression test
lets startup proceed for an empty index when the owner has no database yet:Doctor completed with
importedEntries: 0, the empty index stayed retained on disk — and the startup gate still threw, instructing the user to run the very command that had just run. Deadlock reproduced.After fix (this branch, green)
Same scenario: the gate passes before and after Doctor; Doctor creates no database; the empty index stays retained for the deferred plugin migration.
Test suite (commands shard, including the existing empty-index and deferred-plugin siblings)
tsgo / lint
ClawSweeper review
Both P1 findings are applied in the maintainer narrowing. ClawSweeper's completed review of
812fe61b598bb1723e24c5bbce7ceef772aeca1aconfirms no remaining actionable defect and accepts the real-state startup/Doctor regressions as sufficient behavior proof.State-skip the generic additional migration/upgrade compatibility request under the maintainer's proof ruling. This change adds no schema or stored-format change; Doctor retains import ownership and its discovery validation, and existing receipts keep their database/source identity checks. The regressions cover unused-owner startup, actual unindexed-history import, and rejection of a removed receipt database with real temporary files and SQLite. No separate live Gateway or published-driver campaign was run.
Exact-head CI: https://github.com/openclaw/openclaw/actions/runs/35007208243 completed successfully at
812fe61b598bb1723e24c5bbce7ceef772aeca1a. A local focused run of the five empty-index cases also passed at that head.