Repository navigation
fix(doctor): allow offline state repair for app-owned Gateways - #170768
Conversation
|
ClawSweeper reviews are opt-in for maintainers. If a review is required, finish the work and validation first, then comment |
609844f to
f01be25
Compare
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesAllows standalone Doctor to repair matching offline app-owned Gateway state while leaving service installation and activation to OpenClaw.app. Example: OpenClaw.app's Gateway is stopped and unloaded, and its account has a legacy claude-cli credential profile.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it provides useful standalone recovery, preserves app service ownership, and has no actionable source findings. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherDoctor's maintenance admission sits between CLI repair requests and config or database writers; native service observations select the recovery path, while existing maintenance ownership controls writes. flowchart TD
A[Doctor repair request] --> B[Managed service inspection]
B --> C[App marker and matching state]
C --> D[Verified offline service]
D --> E[Exclusive maintenance custody]
E --> F[Existing config and state repairs]
C --> G[App retains service lifecycle]
Technical reviewBest possible solution: Keep offline state repair with Doctor's existing maintenance owner and app service lifecycle with OpenClaw.app. Do we have a high-confidence way to reproduce the issue? Current main throws the app payload ownership refusal before offline Doctor admission; the source establishes that path, and no target code was executed during this review. Is this the best way to solve the issue? The focused exception reuses native inspection, state selection, offline detection, and maintenance custody rather than adding another repair owner or requiring the existing external-policy environment setting. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a5c56e737b92. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +61, Tests +61, Docs +4. Total +126 across 4 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 13, 2026, 6:03 PM ET / 22:03 UTC (Revision 2). |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
* fix: allow Doctor to repair offline app-owned state * test(doctor): model native manager identity in app-owned repair * test(doctor): retain state-only CLI repair fixture authority (cherry picked from commit 44d880a)
…law#170768) * fix: allow Doctor to repair offline app-owned state * test(doctor): model native manager identity in app-owned repair * test(doctor): retain state-only CLI repair fixture authority
* fix: allow Doctor to repair offline app-owned state * test(doctor): model native manager identity in app-owned repair * test(doctor): retain state-only CLI repair fixture authority (cherry picked from commit 44d880a) Backport adaptation: kept the release line's active-state-writer refusal case from #160056 as an extra row in the new service-identity matrix.
What Problem This Solves
Standalone Doctor refuses to repair offline config and state solely because OpenClaw.app owns the Gateway package and service.
User Impact
openclaw doctor --fixcan repair the same account's state when the app-owned Gateway is verified offline. Package replacement, service installation, and activation remain with OpenClaw.app. A running app-owned Gateway retains its ownership refusal. The app's existing explicit external-owner repair flow remains available; this is standalone recovery ergonomics and does not settle an app update receipt.Why This Change Was Made
Doctor consumes the existing package-ownership refusal through passive native inspection, validates the app marker and selected account/config/state, and uses the existing offline predicate. It grants no service mutation authority; existing custody, maintenance leases, backups, and required state checks remain authoritative.
Evidence
pnpm test src/commands/doctor-maintenance.service-identity.test.ts --maxWorkers=1: 4 tests passed, 13.35-second suite / 16.09-second wrapper (74% transforms); the Linux refusal control takes 9 ms. Doctor test types passed again in 3.6 seconds. The preceding failed-head CI Doctor shard took 318.23 seconds and exposed the CLI fixture authority error; final-head CI cost will be recorded when available.