Skip to content

fix: doctor misses configured Tailscale startup prerequisites - #166947

Merged
RomneyDa merged 3 commits into
mainfrom
fix/doctor-tailscale-preflight
Oct 9, 2026
Merged

RomneyDa merged 3 commits into
mainfrom
fix/doctor-tailscale-preflight

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Current conflict integration — October 9, 2026

Current candidate: 3d59e6fd01259e8bf363e736d75c6699300f7497, incorporating main bfe4592a7e8195d277ef14f3a458cf7396bc125e. Preserves upstream collectTailscaleConfigWarnings and 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.
  • Fresh independent autoreview of the staged complete PR delta against incorporated main: scoped-clean through P2.
  • Staged changed checks against the incorporated base passed formatting, conflict/line-cap/assertion/SQLite/mock-export ratchets, dependency/config-doc/plugin-boundary guards and wrapper checks. The aggregate check did not pass: its typecheck boundary rejects borrowed dependency symlinks before compiling. Shared dependencies were not reinstalled, modified, or bypassed. An initial incorrectly based run reported unrelated old-HEAD/main ratchet differences; the pinned staged replay corrected that comparison.
  • git diff --cached MERGE_HEAD --check passed before commit; native git merge-tree --write-tree HEAD origin/main was conflict-free against fetched main c75ff3cbf56ea8d00d1f33599482901999098f8d.

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 --json through 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

  • The actual Doctor startup regression failed on the original startup entrypoint (11 failures, three unaffected controls), then passed after wiring the prerequisite check.
  • 52 focused tests passed across Doctor startup, existing Tailscale migration, and shared status discovery.
  • New startup file: pnpm test src/flows/doctor-health-startup.test.ts --maxWorkers=1 passed 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.
  • Independent autoreview through P2: scoped-clean. Four existing full-Doctor flow cells passed (ordinary/updater inspection failure and runtime-only ownership); the optional broad suite was then interrupted gracefully after 347.96 s (exit 130), so full-file success is not claimed. Composite changed validation passed: the full selected check passed all guards, core production types, 27 core-test graphs, and dead-export scans before a consistent-return lint failure. A semantics-identical explicit-undefined correction passed exact changed-file lint and formatting; all eight remaining selected schema/store/media/sidecar/import/webhook/pairing guards passed separately. An aggregate rerun exit-zero is not claimed.
  • No operator configuration, Gateway, Tailscale connectivity, or routes were changed for proof. Initial command-response proof was synthetic; the later live backend and published-driver evidence is described below.

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 rejects readSourceConfigBestEffort. Candidate Doctor failed and the harness verified healthy baseline Gateway recovery. The follow-up uses the existing resolveDoctorRepairMode(options).updateInProgress owner 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 other test-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 prepareDoctorHealthFlow run 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 head 69ee5e1dc9282829bce36eb175f4fda9b127a262: 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 ID 2026.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 69ee5e1dc9282829bce36eb175f4fda9b127a262 replay 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 69ee5e1dc9282829bce36eb175f4fda9b127a262 was built and packed by scripts/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 -g into a disposable prefix, then the installed prefix was transferred unchanged to a network-none Docker container. Ordinary installed doctor --non-interactive completed with exit 0; this exercised the shipped CLI startup, not a source-function call or --lint bypass. OPENCLAW_UPDATE_IN_PROGRESS was 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 (commit 5fb2a81b065b0a0bbbfc67ab20a0d9c6a1108115), copied from immutable official image tailscale/tailscale@sha256:c507f3a2a6ab1cabd8d809b98edeb41edbd5c3fb6ad9632ffd098b4c7d0b4065. Its private daemon ran:

tailscaled --tun=userspace-networking --state=mem: \
  --socket=/var/run/tailscale/tailscaled.sock

The real tailscale status --json reported BackendState: 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:

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-interactive

Relevant transcript, in actual output order:

OpenClaw 2026.9.8 (69ee5e1)
OpenClaw doctor
Gateway startup prerequisite
Gateway startup requires a running Tailscale backend because
 gateway.tailscale.mode="serve". Tailscale is logged out. Sign in
 through the Tailscale app or `tailscale login`, then verify `tailscale
 status --json` reports Running before restarting the Gateway.
[Startup optimization, then Doctor changes preview]
[State integrity begins at output line 78]
Health check failed: GatewayTransportError: Gateway not reachable at ws://127.0.0.1:28379 (ECONNREFUSED).
Gateway service is managed externally; skipped service install/start
Doctor complete.
doctor exit: 0

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:

Real status/config Before SHA-256 After SHA-256
tailscale status --json 2e6dced71eca7569519eb4e45420e92758919f12fb007ef9f76bc10c4850a1ca 2e6dced71eca7569519eb4e45420e92758919f12fb007ef9f76bc10c4850a1ca
tailscale serve status --json ca3d163bab055381827226140568f3bef7eaac187cebd76878e0b63e9e442356 ca3d163bab055381827226140568f3bef7eaac187cebd76878e0b63e9e442356

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; tailscale down on 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.

@clawsweeper

clawsweeper Bot commented Oct 8, 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 gateway Gateway runtime commands Command implementations size: S labels Oct 8, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 8, 2026
@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Doctor, 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.

  • Before: Doctor proceeds without an early explanation that Tailscale is logged out.
  • After: Doctor first displays “Gateway startup prerequisite,” explains that Tailscale is logged out, and directs the user to sign in through the app or tailscale login.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, worthwhile diagnostic repair with installed-CLI proof, compatible published-updater execution, and no open findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The installed CLI at 69ee5e1 emitted the early NeedsLogin advisory against a real isolated Tailscale daemon and preserved backend/route hashes; a published-driver replay verified successful update settlement and state continuity. The integration preserves both exercised production paths, so the clearly identified historical proof remains applicable. Source inspection verifies no stored-format change.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: When configured Tailscale cannot support Gateway startup, Doctor makes users work through unrelated maintenance before explaining the missing prerequisite.
Reason: The maintainer-confirmed scope is a prominent ordinary-Doctor advisory with existing updater behavior preserved. The patch completes that bounded diagnostic repair; broader supervisor recovery is explicitly separate.

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
Reviewed head: 3d59e6fd01259e8bf363e736d75c6699300f7497

Before merge

None.

Findings

None.

Agent review details

How this fits together

Doctor 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
Loading

Technical review

Best 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

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Introduced behavior: The pinned introduced delta adds an early source-config read, a bounded backend-status inspection, diagnostic messages, startup regressions, and a documentation note; existing route diagnostics remain intact. (src/flows/doctor-health-startup.ts:44, 3d59e6fd0125)
  • Still necessary on current main: Fetched main's startup module returns after the existing Nix check without inspecting Tailscale prerequisites. The three changed production files have no intervening difference between the incorporated base and fetched main. (src/flows/doctor-health-startup.ts:42, 87d3db2aea6a)
  • Installed CLI behavior proof: The fully retrieved PR body, captured with sourceBodySha256 4599a0e9d30f76dd83e43b58e973d1ed2766b9f3981943ccacc00a61016f2a23, records an installed candidate running ordinary doctor --non-interactive against a real isolated Tailscale 1.102.5 daemon. NeedsLogin produced the prerequisite panel before maintenance, Doctor completed, and backend status and Serve configuration hashes stayed unchanged. (69ee5e1dc928)
  • Published-updater compatibility: The body records a completed published 2026.9.8-to-candidate replay with successful settlement, candidate readiness, durable session/history continuity, and unchanged sidecar bytes. The initially failing restricted config-bridge read was repaired by deferring this advisory using the existing update-context owner. Source inspection confirms no stored representation or migration change. (src/flows/doctor-health-startup.ts:44, 69ee5e1dc928)
  • Historical proof remains applicable: Comparison with the proven original head shows unchanged startup advisory and shared backend inspection. Integration only adopts main's canonical route-warning projection in the diagnostic module; historical runtime proof is not represented as current-head execution. (src/commands/doctor-tailscale.ts:11, 3d59e6fd0125)
  • Accepted bounded product scope: The MEMBER-authored discussion explicitly defines this PR's completed scope as the ordinary Doctor prerequisite advisory with updater compatibility preserved. Supervisor policy remains separate work in [Bug]: Gateway crash-loops silently for hours when the Tailscale backend is stopped (mode=serve + launchd KeepAlive) #144845.

Likely related people:

  • Peter Steinberger: Raw commit 260a319 adds src/flows/doctor-health-startup.ts:26 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 260a31989937; files: src/flows/doctor-health-startup.ts)
  • Pavan Kumar Gondhi: Raw commit 6e026c2 adds src/shared/tailscale-status.ts:141 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 6e026c2fe3fe; files: src/shared/tailscale-status.ts)

PR surface

Source +76, Tests +142, Docs +1. Total +219 across 5 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 3 76 0 +76
Tests 1 142 0 +142
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 219 0 +219

Review metrics

Metric Value Why it matters
Production versus tests Production +76 lines; tests +142 lines Production growth is justified by the bounded advisory, shared status inspection, and published-updater deferral.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This improves diagnosis of a configured startup dependency without changing Gateway availability or recovery policy.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (9 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-08T03:53:49.799Z sha 4188799 :: blocked before merge. :: none
  • reviewed 2026-10-08T04:32:12.332Z sha 69ee5e1 :: blocked before merge. :: none
  • reviewed 2026-10-08T05:04:13.131Z sha 69ee5e1 :: blocked before merge. :: none
  • reviewed 2026-10-08T05:13:21.354Z sha 69ee5e1 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-08T05:45:36.706Z sha 69ee5e1 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-08T05:51:40.521Z sha 69ee5e1 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-08T06:19:06.413Z sha 69ee5e1 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-09T22:19:23.881Z sha 3d59e6f :: needs maintainer review before merge. :: none

Reviewed October 9, 2026, 6:29 PM ET / 22:29 UTC (Revision 10).

@RomneyDa
RomneyDa marked this pull request as ready for review October 8, 2026 03:50
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Oct 8, 2026
@RomneyDa

RomneyDa commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

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 readSourceConfigBestEffort operation. The isolated Docker cell failed at candidate Doctor and recovered the baseline Gateway successfully.

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.

@RomneyDa

RomneyDa commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

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

@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Oct 8, 2026
@RomneyDa

RomneyDa commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

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

@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Oct 8, 2026
@RomneyDa

RomneyDa commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

Completed the previously missing whole installed CLI proof against a real non-running Tailscale daemon at unchanged exact head 69ee5e1dc9282829bce36eb175f4fda9b127a262. Full command, transcript, provenance, and before/after hashes are now in the PR body. This supplements the published-updater replay with the actual changed prerequisite behavior; no proof waiver is requested.

Installed CLI × real isolated Tailscale prerequisite proof

Exact head 69ee5e1dc9282829bce36eb175f4fda9b127a262 was built and packed by scripts/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 -g into a disposable prefix, then the installed prefix was transferred unchanged to a network-none Docker container. Ordinary installed doctor --non-interactive completed with exit 0; this exercised the shipped CLI startup, not a source-function call or --lint bypass. OPENCLAW_UPDATE_IN_PROGRESS was 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 (commit 5fb2a81b065b0a0bbbfc67ab20a0d9c6a1108115), copied from immutable official image tailscale/tailscale@sha256:c507f3a2a6ab1cabd8d809b98edeb41edbd5c3fb6ad9632ffd098b4c7d0b4065. Its private daemon ran:

tailscaled --tun=userspace-networking --state=mem: \
  --socket=/var/run/tailscale/tailscaled.sock

The real tailscale status --json reported BackendState: 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:

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-interactive

Relevant transcript, in actual output order:

OpenClaw 2026.9.8 (69ee5e1)
OpenClaw doctor
Gateway startup prerequisite
Gateway startup requires a running Tailscale backend because
 gateway.tailscale.mode="serve". Tailscale is logged out. Sign in
 through the Tailscale app or `tailscale login`, then verify `tailscale
 status --json` reports Running before restarting the Gateway.
[Startup optimization, then Doctor changes preview]
[State integrity begins at output line 78]
Health check failed: GatewayTransportError: Gateway not reachable at ws://127.0.0.1:28379 (ECONNREFUSED).
Gateway service is managed externally; skipped service install/start
Doctor complete.
doctor exit: 0

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:

Real status/config Before SHA-256 After SHA-256
tailscale status --json 2e6dced71eca7569519eb4e45420e92758919f12fb007ef9f76bc10c4850a1ca 2e6dced71eca7569519eb4e45420e92758919f12fb007ef9f76bc10c4850a1ca
tailscale serve status --json ca3d163bab055381827226140568f3bef7eaac187cebd76878e0b63e9e442356 ca3d163bab055381827226140568f3bef7eaac187cebd76878e0b63e9e442356

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; tailscale down on 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.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@RomneyDa

RomneyDa commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

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

@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@RomneyDa RomneyDa added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 8, 2026
@RomneyDa

RomneyDa commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

Conflict integration pushed at 3d59e6fd01259e8bf363e736d75c6699300f7497. Preserved upstream's canonical Tailscale diagnostic owner and the existing read-only advisory/update deferral. Fresh 53/53 focused tests, official scoped lint/format/diff checks, and independent P0–P2 autoreview pass. The broad local changed checker stops at its borrowed-dependency type boundary; that is recorded, not claimed green.

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

@clawsweeper

clawsweeper Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@RomneyDa
RomneyDa merged commit 06ecc30 into main Oct 9, 2026
137 checks passed
@RomneyDa
RomneyDa deleted the fix/doctor-tailscale-preflight branch October 9, 2026 23:55
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 10, 2026
…aw#166947)

* fix: report configured tailscale startup prerequisites early in doctor

* fix: defer doctor prerequisite reads during published updates
RomneyDa added a commit that referenced this pull request Oct 14, 2026
* 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant