Skip to content

fix(update): report when repair leaves an already stopped Gateway offline - #157134

Merged
steipete merged 2 commits into
mainfrom
upd/153409-repair-offline-outcome
Sep 24, 2026
Merged

steipete merged 2 commits into
mainfrom
upd/153409-repair-offline-outcome

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Supersedes #153409 (merged onto current main; author @RomneyDa)
Refs #153401

What Problem This Solves

Fixes update repair completing without explaining that an already stopped managed Gateway remains offline, while omitting maintenance warnings from its final JSON outcome.

User Impact

Standalone repair reports the intentional non-start and names openclaw gateway start, including the selected profile. Maintenance warnings appear in postUpdate.doctor.warnings, with status: "warning" and a successful exit when other work succeeds. Installation-drift remediation retains precedence over ordinary start guidance.

Why This Change Was Made

Doctor maintenance already owns the service decision and its warning list. Finalization now collects those warnings after maintenance finishes. The Gateway stays stopped unless repair itself owns restoration; parent-owned activation remains with the updater.

RomneyDa's original commit is retained as a merge parent. This changes reporting only: no schema, persisted format, configuration option, or activation policy changes. It applies when the installed candidate runs repair/finalization; it cannot patch an older updater already running in memory. The original PR's published-2026.9.4 recovery-boundary trace remains historical compatibility evidence, not a new native smoke run.

Evidence

  • Full importer and sibling batch on the rebased head with OPENCLAW_TESTBOX=1: 35 files, 1,231 tests passed, exit 0, 563.2 s. Blacksmith Testbox tbx_01m395vb6qjp1wa54b3trdc6zs (run); source SHA and file hashes were verified before execution. The lease completed and was stopped.
  • Focused proof: 119 tests passed across doctor-maintenance.settlement.test.ts, update-command-lifecycle.test.ts, and doctor-maintenance.installation.test.ts. Measured single-file pnpm test <file> --maxWorkers=1 wall times were 13.06 s, 22.51 s, and 51.27 s, respectively. The two new tests took 2 ms and 102 ms in those runs. All three files also passed in the final importer batch.
  • Offline-reporting negative control: reports an already stopped Gateway without starting it after repair fails with an empty warning list when the offline-warning block is removed. The candidate asserts both recorded and logged guidance, with no restart or health call.
  • Finalization-JSON negative control: includes service restoration warnings in the repair outcome fails when warning forwarding after finish() is removed: JSON incorrectly reports ok and omits Doctor warnings.
  • Installation-drift negative control: Doctor handles two-prefix drift through maintenance finish (already-stopped) fails when the drift branch's early return is removed: ordinary start advice appears alongside the specific installation-repair warning.
  • pnpm check:changed: exit 0 in 1,617.7 s, including core types, all 25 selected test-type graphs, and changed-file lint with zero warnings/errors. This run preceded the single merge-preserving rebase; all five changed files are byte-identical afterward. git diff --check also passes.
  • Fresh autoreview --mode branch --base origin/main, P0–P2: scoped-clean on the rebased branch. Service operations in the regression proof use synthetic boundaries.
  • Known existing test cost: update-cli.test.ts passed all 515 cases in 249.644 s in the final batch (234.146 s in the earlier run). Its split into 22 files is tracked by test(cli): split and speed up update-cli tests #157018; that split was not merged into this base. No timeouts, assertions, retries, or test tiers were changed.

Diff size: production +13/−0, tests +36/−0, documentation +7/−0. Hosted PR CI timings are pending at author handoff.

RomneyDa and others added 2 commits September 20, 2026 11:29
…line

Merge #153409 onto current main, preserving its contributor commit and installation-drift remediation precedence. Include maintenance warnings in finalization outcomes and document the intentional offline result. Refs #153401.
@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes commands Command implementations size: XS labels Sep 24, 2026
@steipete
steipete marked this pull request as ready for review September 24, 2026 07:58
@steipete
steipete enabled auto-merge (squash) September 24, 2026 08:02
@clawsweeper

clawsweeper Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 24, 2026, 4:04 AM ET / 08:04 UTC.

ClawSweeper review

What this changes

The branch adds profile-aware guidance when repair leaves a managed Gateway stopped, forwards Doctor maintenance warnings to the final JSON result, and documents those outcomes.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open. Current main still omits the stopped-Gateway warning and its final JSON reporting. This branch is a viable path for that focused fix; the earlier related PR remains open and unmerged. No actionable patch defect was found.

Priority: P2
Reviewed head: 81da94c1dea4a67b7b0ffa713cfd7ae03f5a29b4

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused patch with meaningful historical native evidence and targeted regression checks; the native trace predates this exact head.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The MEMBER-authored PR is exempt from the contributor proof gate. An earlier native macOS repair trace demonstrates the retained warning path against published-driver recovery state; this head adds reporting tests and docs but has no new native run. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored PR is exempt from the contributor proof gate. An earlier native macOS repair trace demonstrates the retained warning path against published-driver recovery state; this head adds reporting tests and docs but has no new native run. No stored-data contract changes.
Evidence reviewed 7 items Introduced service guidance: The introduced branch warns only for an owned, already offline service without parent-owned activation, and gives installation-drift guidance precedence.
Warning reaches finalization: Finalization collects maintenance warnings after restoration finishes and before constructing the result status and Doctor warning array.
Current main comparison: Fetched main lacks both the ordinary already-stopped warning and forwarding of maintenance warnings after finish; the verified test merge adds the same production hunks without removing base behavior.
Findings None None.
Security None None.

How this fits together

Update repair runs Doctor maintenance after an interrupted update. Doctor decides whether the managed Gateway should remain stopped or be restored; finalization turns its warnings into terminal output and update history.

flowchart TD
  A[Update repair command] --> B[Doctor maintenance]
  B --> C{Gateway service state}
  C --> D[Leave previously stopped service offline]
  C --> E[Restore service stopped by repair]
  D --> F[Maintenance warnings]
  E --> F
  F --> G[Final JSON and update history]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +13, Tests +36, Docs +7. Total +56 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 2 13 0 +13
Tests 2 36 0 +36
Docs 1 7 0 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 56 0 +56

Review metrics

None.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-maintenance.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: canonical
Canonical: #157134
Summary: This branch carries the focused reporting fix from the older open PR; the recovery issue covers several additional boundaries.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Use one repair path that preserves operator-controlled service activation and gives a profile-specific recovery instruction in both human and JSON outcomes.

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

Yes, from source: current main can finish repair with an owned Gateway already offline without producing the ordinary warning or carrying maintenance warnings into final JSON. I did not execute that path in this read-only review.

Is this the best way to solve the issue?

Yes. The branch reports the decision through Doctor's existing maintenance owner and finalization warning collector while retaining installation-drift precedence.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2e00063a06c4.

Labels

Label changes:

  • add P2: This corrects misleading update-repair reporting for an already stopped managed Gateway without changing activation behavior.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.

Label justifications:

  • P2: This corrects misleading update-repair reporting for an already stopped managed Gateway without changing activation behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • RomneyDa: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Patrick Erichsen: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations docs Improvements or additions to documentation size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants