Repository navigation
fix: gateway diagnostics hide startup failures behind unrelated log lines - #166946
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. Reviewed October 8, 2026, 1:54 AM ET / 05:54 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR selects recognized Gateway startup errors instead of informational log tails and replaces unsupported warm-up guidance with qualified readiness diagnostics. Example: Run gateway status --deep after Tailscale startup fails
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR is ready within the clarified startup-diagnostics scope: the native CLI proof covers the changed behavior, and no actionable findings remain. Current main still needs this repair; the broader outage remains separate work. Priority: P2 Before mergeNone. FindingsNone. Provenance
Agent review detailsHow this fits togetherGateway diagnostics combine native service state, connection checks, and recent service logs to help operators investigate startup failures. The shared log reader supplies error evidence to status, Doctor, and onboarding. flowchart TD
A[Native service state] --> D[Gateway status collection]
B[Connection check] --> D
C[Bounded service log tail] --> E[Recognized error selection]
E --> D
D --> F[Qualified readiness and error output]
E --> G[Doctor and onboarding diagnostics]
Technical reviewBest possible solution: Keep one bounded error reader and accurate readiness guidance, while tracking generation-bound diagnostics and crash-loop recovery separately. Do we have a high-confidence way to reproduce the issue? Yes: current-main source omits the startup-failure pattern and falls back to arbitrary trailing output; the supplied regressions and actual failed-Gateway CLI transcript exercise that mechanism. This review did not execute target code. Is this the best way to solve the issue? Yes: extending the existing error selector and removing its misleading fallback is a focused repair, with qualified output that accurately preserves historical uncertainty. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b271dcd23352. Provenance checked
TestingProof path: shipped entry point. Added test files: 3. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +5, Tests +16, Docs +7, Other -1. Total +27 across 12 files. View PR surface stats
LabelsLabel 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 (3 earlier review cycles) |
|
Completed the previously missing exact-head distributed CLI proof against actual macOS launchd. Full provenance, controlled failure, actual terminal results, independent PID/readiness checks and healthy controls are now in the PR body. No code/head change or proof waiver. Exact-head CLI × actual failed native Gateway proofUnchanged head The failure used a real private Tailscale CLI/daemon 1.102.5 from official immutable image Actual production log sequence (no fabricated/appended lines): The final physical log line is informational recovery guidance. The prior arbitrary-tail fallback could report that as the last error; the actual candidate instead selected the real startup failure. Ran: node /Users/dallin/openclaw-native-diagnostics/dist/entry.js --profile proof166946 gateway status --deepActual CLI result (exit 0, diagnostic command rather than health-success assertion): Assertions over captured real output: startup failure selected; historical/generation uncertainty qualified; no generic Healthy/no-error control: archived the actual failed log, emptied only this stopped task profile's log, set its Tailscale mode off, and started the real native Gateway. Independent Limits: this is actual macOS Gateway/native-service evidence with a genuine isolated Linux Tailscale backend transported through the vendor CLI. It does not claim operator backend mutation, database corruption, a new updater replay, native Linux/Windows service coverage, or that historical log evidence identifies the current generation. An initial fixture setup attempt lacked the private PATH and hit a real existing route ownership refusal; the guard explicitly left that route unchanged. That attempt is excluded from the claimed NeedsLogin proof. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Maintainer-requested product scope clarification: the restart/Doctor incident was deliberately split into five independent PRs (#166942, #166946, #166947, #166948, #166950). This PR completes the startup diagnostic opportunity: select actual startup failure lines, reject arbitrary informational tails, qualify historical log evidence, and avoid claiming warm-up from a PID. The other incident repairs and generation-bound diagnostics remain separate work; this PR does not claim to close the entire linked outage report. Revision 3 accepts the exact-head native failed-Gateway and healthy/no-error controls with diamond proof and patch quality, no findings, and no before-merge items. Please assess completeness against this maintainer-requested diagnostic scope. No proof exemption or rating override is requested. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Related: #144845
What Problem This Solves
Gateway diagnostics could hide
Gateway failed to start:behind a later cleanup message, then present unrelated output as the last Gateway error. Status suggested brief warm-up solely because a service process was running.User Impact
Status and Doctor retain recognized startup failures after cleanup messages. Unconfirmed readiness directs operators to deeper diagnostics. Matching log errors are labeled as potentially belonging to an earlier run.
Why This Change Was Made
A running service process does not establish Gateway readiness. Bounded log-tail selection should report recognized error evidence rather than arbitrary trailing output. Remove the obsolete fallback option and its caller together.
Matching log evidence remains unbound to the boot generation. Downstream classifiers, including onboarding, are not converted to generation-bound evidence in this change.
Evidence
check:changedpassed, including production/test types, lint, dead-export scans and repository guards. The canonical mock baseline prune removes one obsolete fingerprint.git diff --checkpassed.Proof uses synthetic logs and actual command renderer inputs. It did not operate the live Gateway or prove live recovery. Ownership, timeout and persistent-state policies are unchanged.
Exact-head CLI × actual failed native Gateway proof
Unchanged head
454cbf95b0e4cedfdbfdfe5af87cdc54041ee283passed the official completepnpm build; generated runtime build ID2026.9.8-454cbf95b0e4-2026-10-08T05-31-00.668Z. Ran the distributeddist/entry.jsCLI against its actual candidatedist/index.jsGateway managed by macOS launchd (gui/501/ai.openclaw.proof166946, canonical isolated profileproof166946, loopback port 19646, fresh generated token, plugins/browser disabled).The failure used a real private Tailscale CLI/daemon 1.102.5 from official immutable image
tailscale/tailscale@sha256:c507f3a2a6ab1cabd8d809b98edeb41edbd5c3fb6ad9632ffd098b4c7d0b4065. Its Docker container had network none, zero host mounts, userspace networking, in-memory state and realBackendState=NeedsLogin. A transparent task-ownedtailscaleexecutable on this profile's service PATH forwarded commands to that real vendor CLI viadocker exec; it supplied no synthetic JSON or mocked status. The selected Gateway hadgateway.tailscale.mode="serve"and genuinely failed startup.Actual production log sequence (no fabricated/appended lines):
The final physical log line is informational recovery guidance. The prior arbitrary-tail fallback could report that as the last error; the actual candidate instead selected the real startup failure. Ran:
Actual CLI result (exit 0, diagnostic command rather than health-success assertion):
Assertions over captured real output: startup failure selected; historical/generation uncertainty qualified; no generic
Warm-up: launch agentsmessage; no informational cleanup/recovery line labeled as the error. Stopped only this proof service to bound the crash loop.Healthy/no-error control: archived the actual failed log, emptied only this stopped task profile's log, set its Tailscale mode off, and started the real native Gateway. Independent
/healthzand/readyzboth returned HTTP 200 (PID 85684). The same actual status command reportedConnectivity check: ok,Listening: 127.0.0.1:19646, and noRecent Gateway log errororLast gateway error, despite ordinary startup/health-monitor lines in the log. This checks removal of arbitrary-tail fallback through the distributed CLI rather than only the parser unit test.Limits: this is actual macOS Gateway/native-service evidence with a genuine isolated Linux Tailscale backend transported through the vendor CLI. It does not claim operator backend mutation, database corruption, a new updater replay, native Linux/Windows service coverage, or that historical log evidence identifies the current generation. An initial fixture setup attempt lacked the private PATH and hit a real existing route ownership refusal; the guard explicitly left that route unchanged. That attempt is excluded from the claimed NeedsLogin proof.