Repository navigation
fix(sessions): retain Doctor repair for July provider aliases - #163171
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 October 2, 2026, 4:38 AM ET / 08:38 UTC (Revision 9). ClawSweeper reviewWhat this changesDoctor repairs July-era session provider aliases into canonical delivery metadata, updates SQLite query columns, and preserves refusal of retired room-only records. Merge readiness⛔ Blocked before merge - 3 items remain The repair remains necessary because current main still rejects supported July provider-alias records. No introduced correctness defect was identified, but the prior persisted-state upgrade-proof blocker remains unresolved. Priority: P1 Review scores
Verification
How this fits togetherDoctor migrates stored session metadata before OpenClaw runtime readers consume it. Its repairs preserve backups and keep delivery metadata consistent with the SQLite columns used to query sessions. flowchart TD
A[Stored session records] --> B[Doctor inspection]
B --> C{Supported format?}
C -->|Provider aliases| D[Verified backup and repair]
C -->|Retired room grouping| E[Preserve state and explain recovery]
D --> F[Canonical delivery and query columns]
F --> G[Runtime session readers]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +56, Tests +135, Docs +10. Total +201 across 12 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep legacy conversion with Doctor’s existing verified-backup owner and establish published-driver upgrade compatibility before landing. Do we have a high-confidence way to reproduce the issue? Yes, from source: July Doctor preserves provider-only records, and current main rejects those records without canonical delivery. No runtime reproduction was executed in this read-only review. Is this the best way to solve the issue? Yes, the patch restores the supported migration through existing Doctor owners while retaining canonical runtime reads; upgrade safety still needs observed verification. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d1ba4d9bdbd5. LabelsLabel changes: No label 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
HistoryReview history (8 earlier review cycles)
|
6442863 to
6cd969a
Compare
74510f8 to
e9fdfaf
Compare
…3729) Since #163171, Doctor repairs session rows that still carry provider/lastProvider aliases and runtime reads raise a migration-required error until it runs; only room-without-groupChannel rows stay refused with 2026.9.5 intermediate-upgrade guidance. Also drop the retired provider/room names from the session labeling-field list.
…aw#163171) * fix(sessions): retain Doctor repair for July provider aliases * fix(doctor): preserve validated session types during verification * test(doctor): cover supported July provider imports * fix(doctor): migrate provider aliases before delivery normalization * refactor(doctor): keep migration input immutable
…nclaw#163729) Since openclaw#163171, Doctor repairs session rows that still carry provider/lastProvider aliases and runtime reads raise a migration-required error until it runs; only room-without-groupChannel rows stay refused with 2026.9.5 intermediate-upgrade guidance. Also drop the retired provider/room names from the session labeling-field list.
What Problem This Solves
Restores Doctor migration for
provider/lastProvidersession records that supported July releases could still write. The retirement in #163036 incorrectly treated all such records as pre-July data.User Impact
Doctor converts supported aliases to canonical delivery state, saves a verified original-row backup, updates delivery query columns, and invalidates runtime caches. Runtime requires repair rather than converting aliases while reading.
Conversion-required
roomrecords remain retired. The error directs operators to preserve their state, install OpenClaw 2026.9.5, runopenclaw doctor --fix, and upgrade again. Canonical delivery retains ignored provider aliases, and canonicalgroupChannelretains an opaqueroomvalue.Why This Change Was Made
Native provider-alias writers ended in January, but the original v2026.7.1 and v2026.7.35 Doctor import paths still preserved these aliases without canonical delivery. Canonical delivery arrived in
73bba03e4c5a3ed9912e6df7c59f501a5d99bb49on July 24. Retention must follow the last writer, including importers. July importers already normalized room grouping, so the retired room conversion is not restored.The existing shared session-entry transform/rewrite and verified-backup owners handle the repair. Alias conversion runs before delivery normalization, including direct file import and historical verification; reversing that order creates an empty route before the alias repair can see the destination. Retirement detection runs before planning and during the authoritative transactional reread. Raw repair preserves unrelated tokens and snapshots.
Doctor dependency: the focused changes under
src/commands/doctor/sharedmust land together. Conflict resolutions preserve main's conversation-link normalization, retirement guidance, and #163030 cache ownership. There is no new migration owner or runtime compatibility converter.Production delta, from the complete paginated PR files response: +89 / -33 / net +56 across 8 production files. Tests/support/fixtures are excluded. Main already consumed the earlier room-reader deletion; this corrective PR does not claim that reduction again.
Evidence
Reviewed head:
c93dfa4ef208858777e995368c98663590cbdd3b, basedc27a51ce51c93877bb41215d007e35bece2666f. Independent Codex reviews are clean through P2. Normal hooks, formatting, and diff checks passed. The original hook omission was resolved by replaying the full normal hook on its exact staged tree; later commits used normal hooks.Current-head Blacksmith Testbox proof:
tbx_01m3xy4dg6w0pmnzsnpnysaw59, run 36988370936: targeted lint 8.95 s, native SDK report 382.81 s. All three unique declaration changes were inspected: identical policy properties reorder, with no direct export or entrypoint change. Approved acknowledgement:9b909e4b.tbx_01m3y99xthwg7ka0cssnyagrth, run 37006736816: build 714.34 s, package 67.12 s, identity verification 0.09 s. Candidate tar SHA256:312275bc71bf6cc55d676fb8ad64adb19464ba8f80174f518caefd9791437616.--no-restartcells do not claim service-restart proof.agentic-commands-doctor-sessions-cron-sqlite-hosted-2group passed in its original order: 71.34 s. Session-entry, delivery, and legacy-import owner suites passed in 41.27 s. The changed import test's single-worker command cost was 22.44 s. Complete tests phase 182.42 s; complete cells/tests wrapper 628.088 s, exit 0. Final per-test logs could not be downloaded after automatic lease shutdown; native phase successes, timings, and wrapper completion were captured before shutdown. No tests were rerun for that optional log retrieval.The proof fixture was corrected without changing product source or weakening assertions: SQLite result prototypes were normalized for comparison; the actual July writer and neighboring fixtures received explicit titles to avoid unrelated title repair; canonical delivery includes route/context/origin; and raw SQL seeds certify their identity cache separately after the JSON-update invalidation trigger. Whole-row, neighboring-row, backup, snapshot, transcript, and idempotence comparisons remain strict. A later invocation stopped at its remote-environment precheck before running tests and was corrected through explicit native Testbox routing markers.
Inherited CI failures
CI run 36984642589 tested this head at merge
c7bf4f0ad6a9390c22f2948189a0ab8a04eabce5, with maindbb580aed3e79548f98f361e460fb76f1d38c279. Its only originating failed job was the architecture check's Madge cycle betweensrc/process/command-process-custody.tsandsrc/process/exec-spawn.ts. This PR changes neither file nor graph configuration; custody does not exist at standalone PR head. The cycle came from #162614 and was fixed on main by0f470aecdc1208c34df6f233371ff1d6e7484d25.Cancelled type-stripe logs also reported a duplicate
traceproperty in main'ssrc/agents/prepared-model-runtime.test-harness.ts; standalone PR head has neither property and does not change that file. Main fixd81a2d8b7294ec21741d0e8b23e817a237aac9d6removes the duplicate. Both fixes are verified ancestors of current main.Completed exact-head CI lint, boundaries, ratchets, snapshots, security-fast, eight core type graphs, both Knip passes, and package-boundary compile/canary/publication steps are reused. Supplemental native proof above closes every cancelled type/deadcode gap and exercises the original failing migration group. No CI rerun or rebase was used merely to obtain green. The maintainer-authorized pre-existing-failure exception applies to the remaining CI gate status; no owned failure is waived.
Earlier owned failures were repaired: a raw-record overload needed the already-validated
SessionEntrytype; stale import expectations rejected supported aliases; direct import normalized delivery before aliases; and the ordering fix initially reassigned a parameter. No flake fix is claimed.