improve: skip Gateway migration preflight without legacy state#96234
improve: skip Gateway migration preflight without legacy state#96234efpiva wants to merge 1 commit into
Conversation
|
Codex review: needs changes before merge. Reviewed June 24, 2026, 3:43 PM ET / 19:43 UTC. Summary PR surface: Source +728, Tests +876. Total +1604 across 2 files. Reproducibility: yes. by source inspection: the PR awaits plugin doctor detectors without the current collector's try/catch, so a detector exception rejects Review metrics: 1 noteworthy metric.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Copy recommended automerge instructionNext step before merge
Security Review findings
Review detailsBest possible solution: Keep the Gateway skip path, but make detector failures conservatively run the existing doctor preflight and add regression coverage for a throwing plugin detector. Do we have a high-confidence way to reproduce the issue? Yes by source inspection: the PR awaits plugin doctor detectors without the current collector's try/catch, so a detector exception rejects Is this the best way to solve the issue? No; gating Gateway preflight is a reasonable performance direction, but this implementation must preserve the existing fail-soft detector semantics before it is the best fix. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 365279b86f47. Label changesLabel justifications:
Evidence reviewedPR surface: Source +728, Tests +876. Total +1604 across 2 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
69ca69e to
0149e9d
Compare
|
Addressed the ClawSweeper review on the current PR head What changed:
Validation run locally:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Thanks @efpiva. Closing this implementation because its detector-empty fast path now bypasses the mandatory foreground-gateway migration checkpoint landed in #101881 for #98565. The branch also retains an unhandled plugin-detector exception path and a migration catalog that has drifted substantially from current main. The benchmark is still useful; please preserve it in a fresh checkpoint-aware performance follow-up rather than rebasing this 1,600-line branch. |
What Problem This Solves
openclaw gateway runpaid doctor startup preflight work even when no legacy state was present. Earlier versions of this PR skipped too aggressively; the current version keeps the skip only after checking the legacy inputs that the doctor migration path can still handle.Why This Change Was Made
This change gates the Gateway foreground startup doctor migration preflight behind legacy-input detection, matching the existing read-only-command intent while preserving automatic migration for known legacy sources.
The detector now covers or delegates to:
sessions.json, named-account Telegram sidecars, and configured/default account pathsdoctor-contract-apistate migrations by invoking their publicdetectLegacyStatecontract after config loadIt also avoids persistent false positives from already-archived
*.migratedplugin sources, normal current plugin-state rows, current canonical agent directories, current custom session stores, current shared debug-proxy SQLite DBs, and unmigratable Voice Call files underOPENCLAW_HOMEwhen the Voice Call default is OS-home based.User Impact
Gateway startup still runs doctor preflight when legacy/migratable state exists. On no-legacy startup, the reviewed patch keeps a meaningful Gateway-ready improvement, though smaller than the initial draft because the final version preserves generic plugin doctor migration detection.
Latest benchmark artifact:
.artifacts/gateway-startup-upstream/final-reviewed-gateway-startup.json.artifacts/gateway-startup-upstream/final-reviewed-gateway-startup.logP50 Gateway-ready deltas vs the original
origin/mainbaseline artifact.artifacts/gateway-startup-upstream/20260623T215700Z-main-baseline/gateway-startup.json:Evidence
Passed locally on the reviewed head
0149e9d9c1:pnpm test src/cli/program/config-guard.test.tspnpm test extensions/msteams/doctor-contract-api.test.tsOPENCLAW_TSGO_HEAVY_CHECK_LOCK_HELD=1 pnpm tsgo:corepnpm build:dockercodex review --base origin/mainNo discrete correctness issues were identified in the changed config-guard migration detection paths or adjacent migration contracts reviewed.pnpm test:startup:gateway --runs 5 --warmup 1 --output .artifacts/gateway-startup-upstream/final-reviewed-gateway-startup.jsonEarlier full-suite caveat still applies:
pnpm testwas run before the review-fix loop and failed in unrelated shards outside this patch's two changed files. Failures included provider catalog expectations, timing/process tests, backup late-SQLite tests, security scan allowlist tests, and script resolver tests. The failure log is.artifacts/gateway-startup-upstream/pnpm-test-gateway-preflight-final.log.