Repository navigation
fix: doctor misses configured Tailscale startup prerequisites - #166947
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: needs maintainer review before merge. What this changesDoctor, OpenClaw’s diagnostic command, reports missing local Tailscale startup prerequisites before maintenance and repair prompts while preserving updater compatibility. Example: Run ordinary Doctor with gateway.tailscale.mode="serve" while Tailscale reports NeedsLogin.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR remains useful and ready for ordinary landing review: current main lacks its advisory, related recovery work does not supersede it, and no actionable patch defect remains. Maintainer authorship also prevents cleanup closure. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherDoctor checks and repairs an OpenClaw installation before testing Gateway health. This change reads configured Tailscale exposure and local backend status, then prints an advisory without changing connectivity, routes, or authentication. flowchart TD
A[Doctor command] --> B[Updater context]
B -->|Ordinary run| C[Read source configuration]
B -->|Update underway| G[Continue existing Doctor flow]
C --> D[Local Serve or Funnel configured]
D -->|Yes| E[Read Tailscale backend status]
D -->|No| G
E --> F[Print prerequisite and recovery action when needed]
F --> G
Technical reviewBest possible solution: Keep the early read-only advisory and updater deferral, with supervisor recovery handled separately. Do we have a high-confidence way to reproduce the issue? Yes, from source: ordinary Doctor on current main has no early backend-state advisory for configured local Serve/Funnel. Contributor evidence also shows the installed candidate diagnosing a real NeedsLogin daemon; this read-only review did not execute target code. Is this the best way to solve the issue? Yes. The patch uses the existing source-config, update-context, and shared status owners, preserves route diagnostics, and addresses the agreed diagnostic scope without changing supervisor behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 87d3db2aea6a. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +76, Tests +142, Docs +1. Total +219 across 5 files. Added test files: 1. View PR surface stats
Review metrics
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 (9 earlier review cycles; latest 8 shown)
Reviewed October 9, 2026, 6:29 PM ET / 22:29 UTC (Revision 10). |
|
Additional compatibility proof found a real defect despite green PR CI: published OpenClaw 2026.9.8 updating to this exact candidate invokes candidate Doctor under its config bridge, which refuses the newly added early I am fixing the advisory to respect the existing shipped update-context contract, adding the missing regression, and rerunning the published-driver cell before declaring this PR ready to merge. Ordinary standalone Doctor will retain the early Tailscale prerequisite check. No operator state was used or modified for this proof. |
|
The corrected exact head 69ee5e1 now has green hosted CI and a complete passing published 2026.9.8 → candidate compatibility cell. The body records the initial real bridge defect, fail-first regression and repair, current-head real Running Tailscale startup-flow proof, and the diagnosed cold-cell proof-envelope timeout separately from the successful unchanged-budget retry. No stored schema, data format or config-bridge authority change is introduced. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Revision 4 explicitly accepts the exact-head published update replay and verifies no stored-data contract change, but its remaining data-model checkbox still requests compatibility proof. The body now collects that assessment under Data-model compatibility assessment: the completed 2026.9.8 → exact 69ee5e1 replay covers candidate Doctor plus durable state/session continuity, serving identity and sidecar preservation. This is the evidence for the path-based migration/backfill flag; no authorship exemption or proof waiver is requested. Please assess the sufficiency of that completed compatibility evidence alongside the no-format-change source delta. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Completed the previously missing whole installed CLI proof against a real non-running Tailscale daemon at unchanged exact head Installed CLI × real isolated Tailscale prerequisite proofExact head The tarball was installed with real Tailscale was the real official CLI/daemon version tailscaled --tun=userspace-networking --state=mem: \
--socket=/var/run/tailscale/tailscaled.sockThe real The actual installed command was: HOME=/home/appuser \
OPENCLAW_STATE_DIR=/home/appuser/.openclaw \
OPENCLAW_CONFIG_PATH=/home/appuser/.openclaw/openclaw.json \
PATH=/usr/local/bin:/usr/bin:/bin \
node /tmp/candidate/lib/node_modules/openclaw/dist/index.js doctor --non-interactiveRelevant transcript, in actual output order: The prerequisite was the first panel after the intro (line 3), before repair preview and state integrity. Backend status and Serve configuration remained byte-identical after the whole Doctor command:
Limits: this proves a genuine unauthenticated NeedsLogin non-running prerequisite through the whole Linux installed CLI. It does not claim an authenticated Running control or a Stopped backend; @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Maintainer-requested product scope clarification: this restart/Doctor incident was deliberately divided into five independently reviewable PRs (#166942, #166946, #166947, #166948, #166950). The intended completed behavior for this PR is the early read-only Tailscale prerequisite in ordinary Doctor, with updater compatibility preserved. The linked #144845 supervisor-loop policy is related context, not an acceptance criterion or a claim that this PR closes the broader incident. The operator explicitly requested this split; widening this PR into supervisor policy would mix separate behavior and ownership concerns. Revision 6 has now accepted the actual installed-CLI prerequisite proof and exact-head upgrade replay with no findings or before-merge items. Please assess the product completeness against that intended bounded advisory scope, retaining #144845 as separate work. No proof exemption or rating override is requested. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Conflict integration pushed at The body now separates current integration evidence from historical installed-CLI, real Tailscale, and published-updater proofs. No merge or operator Gateway/state change. The prior review is older than 12 hours; please assess this exact conflict integration with the updated evidence. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…aw#166947) * fix: report configured tailscale startup prerequisites early in doctor * fix: defer doctor prerequisite reads during published updates
* fix: report configured tailscale startup prerequisites early in doctor * fix: defer doctor prerequisite reads during published updates (cherry picked from commit 06ecc30) Backport adaptation: placed the new prerequisite helper beside the release branch's retained Tailscale migration-result wrapper instead of main's removed one.
Current conflict integration — October 9, 2026
Current candidate:
3d59e6fd01259e8bf363e736d75c6699300f7497, incorporating mainbfe4592a7e8195d277ef14f3a458cf7396bc125e. Preserves upstreamcollectTailscaleConfigWarningsand removal of the obsolete migration-result wrapper, while retaining the early read-only prerequisite advisory and published-updater deferral. No production behavior was added by conflict repair; the complete PR adds 76 production lines for the named advisory capability, 142 test lines, and one documentation line.Fresh integration proof:
node scripts/run-vitest.mjs src/flows/doctor-health-startup.test.ts src/commands/doctor-tailscale.test.ts src/shared/tailscale-status.test.ts: 53/53 passed, runner wall 55.02 s.node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/commands/doctor-tailscale.ts src/flows/doctor-health-startup.ts src/flows/doctor-health-startup.test.ts src/shared/tailscale-status.ts: passed.git diff --cached MERGE_HEAD --checkpassed before commit; nativegit merge-tree --write-tree HEAD origin/mainwas conflict-free against fetched mainc75ff3cbf56ea8d00d1f33599482901999098f8d.The installed CLI, real isolated Tailscale backend, native proof and published-driver replay below remain historical original-head evidence at
69ee5e1dc9282829bce36eb175f4fda9b127a262; they were not rerun on this integration and are not current-head CI. This refresh reuses those proofs only for unchanged behavior. Exact-head hosted CI run 37998156126 completed successfully; GitHub reports no pending or failed checks. The fresh exact-head ClawSweeper assessment is diamond lobster for readiness, proof and patch quality, with no findings or before-merge items. The PR is open, non-draft, conflict-free and ready for review. No merge, deployment, or operator Gateway/state change.Related: #144845
What Problem This Solves
Fixes Doctor burying the configured Tailscale startup dependency when a local Serve/Funnel Gateway cannot start because the backend is stopped, logged out, awaiting machine approval, or unavailable.
User Impact
Ordinary Doctor reports a prominent prerequisite and next action before offline maintenance and repair prompts. It leaves connectivity, routes, configuration, and authentication unchanged. A running backend alone does not prove Gateway or route readiness.
Why This Change Was Made
Read source config without database admission or plugin validation, then inspect bounded local
tailscale status --jsonthrough the shared status owner. Distinguish backend states from unreadable status, accept logged-out status JSON even when the CLI exits nonzero, and retain the macOS app-binary fallback. Remote Gateways and unmanaged exposure incur no Tailscale command.This is separate from #142668's opt-in mobile pairing diagnostic: it checks the configured startup prerequisite in ordinary Doctor and performs no HTTP or WebSocket probes. It does not change launchd's restart policy. Update-driven Doctor defers this advisory to preserve the published updater’s restricted config bridge; ordinary Doctor performs the check before maintenance. It does not refuse repairs or Gateway restoration.
Evidence
pnpm test src/flows/doctor-health-startup.test.ts --maxWorkers=1passed 14 tests in 14.79 s command wall (7.94 s Vitest wall, about 1.2 s test execution). The three-shard proof took 135.83 s including a cold command-worker artifact build; the new file performs no polling, process boots, or network requests. Hosted CI passed on the corrected head.Follow-up compatibility and review
The published-driver cell exposed a real regression on the initial PR head
4188799d1c48562c77540ea9dc2cb8e6f9b8c915: published OpenClaw 2026.9.8 invokes candidate Doctor under a restricted config bridge, which rejectsreadSourceConfigBestEffort. Candidate Doctor failed and the harness verified healthy baseline Gateway recovery. The follow-up uses the existingresolveDoctorRepairMode(options).updateInProgressowner to defer only this advisory during updates. Standalone Doctor retains the early prerequisite finding. The shipped bridge and its authority remain unchanged.The new startup-flow regression failed before this correction (one intended failure, fourteen unaffected controls), then all fifteen startup cases and the existing Tailscale siblings passed: 53 tests, 115.80 s repository-runner wall including preparation. Canonical core production types, the changed
othertest-type graph, exact changed-file lint/format and diff checks passed. Fresh independent P2 review: scoped-clean. Published-driver compatibility passed on the committed corrected head; details follow.A production
prepareDoctorHealthFlowrun on the initial head used isolated OpenClaw HOME/config and the real macOS Tailscale CLI: BackendState remained Running, no prerequisite warning was expected, and the Serve route SHA-256 was identical before/after (38d4e2c09f242ff7389a3413187e151ee4b3dfce4a811f8a4e5ce880787b2d6a), in 5.236 s. This is startup-flow proof, not a whole interactive CLI run; stopped/logged-out branches use command-response regressions, and no operator connectivity was changed. The same production startup flow was rechecked on corrected head69ee5e1dc9282829bce36eb175f4fda9b127a262: Running before/after, identical Serve hash, no operator-state writes, 9.312 s. The standalone advisory path is unchanged by the update-context correction.No stored schema, data format, migration transform or config publication is added. The path-based stored-data flag identifies Doctor-related files rather than a new data-model change.
Published-driver × exact candidate — passed
Published OpenClaw 2026.9.8 successfully updated to exact head 69ee5e1 (candidate package SHA-256
069b9c9e1288a46782e52499e5bf9ab3ed05d1bb0673b01cb64397153ddc0dfa; build ID2026.9.8-69ee5e1dc928-2026-10-08T04-17-57.780Z). The canonical Docker harness exited 0 with the durable ledger finished/succeeded, exact installed and serving candidate identity, readiness HTTP 200, managed PID replacement, durable session/history preservation, incognito content removal and byte-preserved orphan OAuth sidecar. Owned service/container/volume cleanup completed.This is real published CLI/updater/candidate-runtime/SQLite execution in disposable state, with a synthetic Linux native-service manager. It does not demonstrate live macOS launchd or interactive TTY behavior. Standalone backend-state branches have the separate startup-flow and command-boundary proof above. No schema or stored format changes are introduced.
The first corrected-head cold cell successfully completed the update in 990.223 s, then exhausted the 1125 s total envelope before its final running-version/session assertions (only 663 ms remained); it is not counted as a complete pass. One diagnosed same-head retry used the canonical CI workflow’s published-driver cache seed, verified as 2026.9.8. Baseline restore took 1.786 s versus 39.608 s cold install; actual update took 480.050 s. Candidate bytes, state fixtures, final assertions and the 1125 s budget were unchanged. The successful complete result is from that retry, not the earlier timeout.
Reproduction:
bash scripts/e2e/published-driver-update-docker.sh /absolute/candidate.tgz /absolute/proof-dir 2026.9.8, with the supported CI-published-driver cache seed present. Exact-head hosted CI is green.Data-model compatibility assessment
Compatibility proof is sufficient for this complete delta: there is no new stored representation, schema, migration transform or config publication, and the published 2026.9.8 → exact
69ee5e1dc9282829bce36eb175f4fda9b127a262replay completed successfully with durable state/session continuity, exact candidate serving identity and unchanged sidecar bytes. The replay directly covers the actual introduced update-context risk (candidate Doctor under the published config bridge). The no-format-change source assessment and completed upgrade replay above jointly address the migration/backfill path flags; those flags are not being waived on maintainer authorship. Package/swap timings varied between attempts, so no performance improvement is claimed.Installed CLI × real isolated Tailscale prerequisite proof
Exact head
69ee5e1dc9282829bce36eb175f4fda9b127a262was built and packed byscripts/package-openclaw-for-docker.mjs; tarball inventory/import-graph/integrity checks passed. Build ID:2026.9.8-69ee5e1dc928-2026-10-08T05-29-39.156Z. Tarball SHA-256:ad98b7d3ec6009d2f367d616ad980c91d24f84bf5f53369c5fcda6e76732e5e6.The tarball was installed with real
npm install -ginto a disposable prefix, then the installed prefix was transferred unchanged to a network-none Docker container. Ordinary installeddoctor --non-interactivecompleted with exit 0; this exercised the shipped CLI startup, not a source-function call or--lintbypass.OPENCLAW_UPDATE_IN_PROGRESSwas unset. Isolated HOME/config/state, loopback port 28379, zero host mounts, and no operator credentials were used.Tailscale was the real official CLI/daemon version
1.102.5(commit5fb2a81b065b0a0bbbfc67ab20a0d9c6a1108115), copied from immutable official imagetailscale/tailscale@sha256:c507f3a2a6ab1cabd8d809b98edeb41edbd5c3fb6ad9632ffd098b4c7d0b4065. Its private daemon ran:The real
tailscale status --jsonreportedBackendState: NeedsLogin, no tailnet identity/IP/auth URL. No synthetic command responses, mock backend, or operator Tailscale state was used. The configured candidate was local, loopback,gateway.tailscale.mode="serve", with plugins disabled.The actual installed command was:
Relevant transcript, in actual output order:
The prerequisite was the first panel after the intro (line 3), before repair preview and state integrity. Backend status and Serve configuration remained byte-identical after the whole Doctor command:
tailscale status --json2e6dced71eca7569519eb4e45420e92758919f12fb007ef9f76bc10c4850a1ca2e6dced71eca7569519eb4e45420e92758919f12fb007ef9f76bc10c4850a1catailscale serve status --jsonca3d163bab055381827226140568f3bef7eaac187cebd76878e0b63e9e442356ca3d163bab055381827226140568f3bef7eaac187cebd76878e0b63e9e442356Limits: this proves a genuine unauthenticated NeedsLogin non-running prerequisite through the whole Linux installed CLI. It does not claim an authenticated Running control or a Stopped backend;
tailscale downon this never-authenticated daemon retained NeedsLogin. No Gateway was deliberately started in this fixture, so the later ECONNREFUSED diagnosis is expected and Doctor exit 0 does not mean Gateway healthy. npm 11.19's default install policy skipped optional dependency/package install scripts; the installed Doctor entrypoint and real backend status calls nevertheless completed. The prior exact-head published-driver update proof remains separate and unchanged. Fresh canonical build cost was 7m37.6s plus 36s tarball checks; no performance improvement is claimed.