Skip to content

fix: startup migration refusal suggests restarting a container - #119406

Merged
steipete merged 1 commit into
mainfrom
steipete/sweet-swirles-931a82
Aug 5, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/sweet-swirles-931a82

Conversation

@steipete

@steipete steipete commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Related: #112395

What Problem This Solves

Fixes an issue where operators using npm, launchd, systemd, or other non-container installs could be told to restart a container when startup migrations refused Gateway readiness.

Why This Change Was Made

The refusal text originated in a container-image migration flow but now serves every Gateway startup method. The remediation now tells operators to run openclaw doctor --fix against the same state/config and restart the Gateway, without assuming a container or service manager.

This is intentionally separate from #114678: it changes only operator guidance and does not alter state-directory classification or migration behavior.

AI-assisted: yes.

User Impact

Operators now receive recovery guidance that is accurate for managed services, foreground processes, containers, and externally supervised Gateways.

Evidence

  • node scripts/run-vitest.mjs src/commands/doctor-config-preflight.process.test.ts — 2 tests passed, including the real-process refusal output, exit status, single emission, and lease cleanup.
  • ./node_modules/.bin/oxfmt --check --threads=1 src/commands/doctor-config-preflight.ts src/commands/doctor-config-preflight.process.test.ts — passed.
  • node scripts/run-oxlint.mjs src/commands/doctor-config-preflight.ts src/commands/doctor-config-preflight.process.test.ts — passed.
  • git diff --check — passed.
  • Source-blind behavior validation — all six refusal contract clauses passed.
  • Codex autoreview — clean, no accepted/actionable findings.
  • node scripts/check-changed.mjs -- ... could not acquire a ready Crabbox provider; the targeted trusted-source local fallback checks above passed.

Real non-container Gateway proof

Ran the actual foreground Gateway from the PR head with an isolated config/state root and a real conflicting plugin-state sidecar. This is a non-container process; temporary paths were omitted from the capture.

[state/db] state database schema migration pending; verifying integrity first
[state-migrations] Legacy state migration warnings:
- Left plugin-state sidecar in place because 1 row differs from shared state without a newer canonical timestamp. First key: discord/components/interaction:1
OpenClaw startup migrations did not complete cleanly; refusing to report the gateway ready.
- Left plugin-state sidecar in place because 1 row differs from shared state without a newer canonical timestamp. First key: discord/components/interaction:1
Run "openclaw doctor --fix" against the same state/config, then restart the gateway.
[ELIFECYCLE] Command failed with exit code 1.

__PROOF_EXIT_CODE__=1
__PROOF_MODE__=foreground-non-container

The capture confirms the operator-visible refusal uses install-neutral guidance, exits 1, and contains no restart the container instruction.

@steipete
steipete marked this pull request as ready for review August 5, 2026 02:03
@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: XS maintainer Maintainer-authored PR labels Aug 5, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 4, 2026, 10:10 PM ET / August 5, 2026, 02:10 UTC.

ClawSweeper review

What this changes

This PR makes startup-migration recovery guidance install-neutral and adds a process-level assertion for the updated text.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 2 items remain

Keep this PR open: current main still sends container-specific recovery text through every Gateway startup, and the branch corrects that shared diagnostic without changing migration behavior. No patch correctness finding was identified; real operator-visible proof is still needed before merge.

Priority: P3
Reviewed head: c87c4b70000ce5782a8ef55abd99486713b46ece

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch is focused and well-covered in source, but merge-quality proof is limited to test claims rather than a demonstrated real operator flow.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The body reports a spawned-process test, but does not include after-fix real-setup output showing the corrected operator-visible refusal; add a redacted terminal capture. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The body reports a spawned-process test, but does not include after-fix real-setup output showing the corrected operator-visible refusal; add a redacted terminal capture. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Current shared diagnostic: Current main still tells every affected operator to restart a container in the sole startup-migration failure formatter.
Gateway caller scope: Gateway and gateway run require the startup checkpoint with no container predicate, then invoke the preflight owner.
Focused branch change: The branch replaces only the shared recovery literal and adds an assertion in the existing spawned-process regression test; the diff is clean.
Findings None None.
Security None None.

How this fits together

Gateway startup runs a migration preflight before reporting readiness. A failed preflight prints its owned recovery message, after which the operator runs Doctor against the active state/config and restarts the Gateway.

flowchart LR
  A[Gateway startup] --> B[Migration preflight]
  B --> C{Migrations ready?}
  C -->|No| D[Startup refusal]
  D --> E[Doctor repair]
  E --> F[Gateway restart]
  C -->|Yes| G[Gateway ready]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The body reports a spawned-process test, but does not include after-fix real-setup output showing the corrected operator-visible refusal; add a redacted terminal capture. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The PR body reports process-test results but has no redacted after-fix terminal output from a real non-container Gateway setup, so the operator-visible wording remains unproven outside test fixtures.
Agent review details

Security

None.

PR surface

Source 0, Tests +3. Total +3 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 1 3 0 +3
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 4 1 +3

Review metrics

Metric Value Why it matters
Production vs test delta production +1/-1, tests +3/-0 The neutral production edit is limited to one shared operator-facing diagnostic and is covered by the existing process-level refusal test.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-config-preflight.process.test.ts, migration/backfill/repair: src/commands/doctor-config-preflight.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the generic wording in the shared formatter, retain container-specific instructions in container documentation, and attach a redacted non-container terminal capture of the corrected refusal before merge.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the generic wording in the shared formatter, retain container-specific instructions in container documentation, and attach a redacted non-container terminal capture of the corrected refusal before merge.

Do we have a high-confidence way to reproduce the issue?

Yes—source establishes that every Gateway startup checkpoint refusal uses the shared container-specific formatter, including non-container gateway runs.

Is this the best way to solve the issue?

Yes—the shared formatter is the correct owner because callers do not identify a container runtime, while container-only documentation can remain specific.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 6a8e11e63cee.

Labels

Label changes:

  • add P3: This is a narrowly scoped correction to recovery guidance with limited functional blast radius.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The body reports a spawned-process test, but does not include after-fix real-setup output showing the corrected operator-visible refusal; add a redacted terminal capture. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P3: This is a narrowly scoped correction to recovery guidance with limited functional blast radius.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The body reports a spawned-process test, but does not include after-fix real-setup output showing the corrected operator-visible refusal; add a redacted terminal capture. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • Shakker: Introduced the current startup-migration formatter and its process-test path in the current-main history. (role: feature introducer; confidence: high; commits: 34e73d25a6f2; files: src/commands/doctor-config-preflight.ts, src/commands/doctor-config-preflight.process.test.ts)
  • steipete: Has several recent Doctor and migration changes in the history of the affected preflight surface. (role: recent area contributor; confidence: medium; commits: a1e5b6ef0ed2, 367ff3cea190; files: src/commands/doctor-config-preflight.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add a redacted terminal capture from a non-container Gateway startup that reaches the updated refusal text, then update the PR body for a fresh review.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready proof for c87c4b70000ce5782a8ef55abd99486713b46ece:

  • Focused process regression: node scripts/run-vitest.mjs src/commands/doctor-config-preflight.process.test.ts — 2/2 passed.
  • Formatting: ./node_modules/.bin/oxfmt --check --threads=1 src/commands/doctor-config-preflight.ts src/commands/doctor-config-preflight.process.test.ts — passed.
  • Lint: node scripts/run-oxlint.mjs src/commands/doctor-config-preflight.ts src/commands/doctor-config-preflight.process.test.ts — passed.
  • git diff --check — passed.
  • Codex autoreview — clean, no accepted/actionable findings.
  • Real non-container proof is now in the PR body: an isolated foreground Gateway emitted the corrected recovery line, omitted restart the container, and exited 1.
  • Exact-head hosted CI run: https://github.com/openclaw/openclaw/actions/runs/30968219867 — passed.
  • OPENCLAW_TESTBOX=1 scripts/pr prepare-run 119406 — passed in hosted_exact_or_recent_parent mode at 2026-08-05T02:23:35Z; the remote PR tree matched the reviewed head.

PR #114678's state-directory classification repair remains separate and untouched. The previous ClawSweeper proof request was applied by adding the redacted real-Gateway terminal capture to the PR body.

@steipete
steipete merged commit 195b0ea into main Aug 5, 2026
186 of 198 checks passed
@steipete
steipete deleted the steipete/sweet-swirles-931a82 branch August 5, 2026 02:28
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 5, 2026
* origin/main: (22 commits)
  refactor(plugins): consolidate lifecycle hook dispatch (#119429)
  fix(ci): stabilize TUI PTY proof ownership (#119420)
  test(system-agent): reduce suite setup overhead (#119424)
  fix(ui): keep session rail pill status from overlapping the headline (#119397)
  fix(discord): avoid doctor runtime loading (#119391)
  fix(media): decouple playback cache retention (#119417)
  fix(slack): infer upload filename extensions from MIME types (#119399)
  refactor(channels): unify configured binding resolution (#119414)
  refactor(google-meet): unify gateway and tool dispatch (#119413)
  test(state): reuse legacy database fixtures (#119423)
  fix(reset): preserve bootstrap guidance for dynamic models (#119179)
  fix(chutes): honor serving context limits (#119196)
  refactor(status): consolidate scan projections and lazy loaders (#119412)
  fix(status): status --all slows down with missing plugins (#119203)
  refactor(gateway): consolidate usage reporting and caches (#119409)
  perf(gateway): keep reload and recovery machinery off gateway cold start (#119094)
  fix(cli): align TaskFlow controller columns for wide text (#118801)
  fix: make startup migration restart guidance install-neutral (#119406)
  fix(ci): preserve cache warmer shard envelopes (#119403)
  fix(sessions): preserve compatible auth profiles on model changes (#117550)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant