Skip to content

fix(cli): report observed gateway start failure - #190756

Open
RomneyDa wants to merge 1 commit into
mainfrom
tideclaw/rri-510-start-health-diagnostics
Open

RomneyDa wants to merge 1 commit into
mainfrom
tideclaw/rri-510-start-health-diagnostics

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Nov 2, 2026

Copy link
Copy Markdown
Member

Summary

  • reuse the canonical health-failure formatter for gateway start
  • report the observed elapsed time and concrete stopped/channel/timeout result
  • preserve the existing still-starting exit contract

Testing

  • pnpm test src/cli/daemon-cli/lifecycle-readiness.test.ts --maxWorkers=1 (13 tests)
  • type-aware oxlint and formatting on changed files
  • git diff --check

@clawsweeper

clawsweeper Bot commented Nov 2, 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 cli CLI command changes size: S labels Nov 2, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 2, 2026
@clawsweeper

clawsweeper Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR makes managed Gateway start failures reuse the existing outcome-aware health formatter.

Example: The service remains stopped for 10 seconds after gateway start.

  • Before: The command reports a 45-second HTTP readiness timeout.
  • After: The command reports that start failed after 10 seconds because the service stayed stopped.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The focused repair has useful unit coverage, but its HTTP-only failure path reports the wrong elapsed duration.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; supplied validation exercises mocked lifecycle outcomes and the real formatter, without a shipped-command runtime trace.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Gateway start reports a timeout even when it has observed a concrete startup failure.
Reason: Accurate failure causes improve recovery, reuse an established owner, and follow the direction already recorded by this maintainer-authored PR.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this PR open: it addresses a real diagnostic bug on current main, but introduces an incorrect timeout duration when only HTTP readiness fails.

Priority: P2
Reviewed head: c938b9b0330de0b89def893f48d3f6ea060b315f

Before merge

  • Use the HTTP wait duration when service health already succeeded (P2) - The two waiters run independently, and reaching this block does not imply that health failed. For example, a stopped channel can leave /readyz at 503 while RPC health succeeds after 1 second because channel runtime warnings do not fail that probe. HTTP readiness then waits through the 45-second deadline, but passing the successful snapshot to this formatter produces Gateway start timed out after 1s waiting for health checks. The base correctly attributed this case to the HTTP deadline. Use the shared formatter for failed service observations, retain HTTP-specific duration reporting when health.healthy is true, and add that mixed-result regression case.

Findings

  • [P2] Use the HTTP wait duration when service health already succeeded — src/cli/daemon-cli/lifecycle.ts:385-389

Tests

  • Missing end-to-end proof: No shipped-CLI trace or demonstrated red-base/green-head run covers service health succeeding early while HTTP readiness exhausts its deadline.
Agent review details

How this fits together

The managed-service CLI combines service health and HTTP readiness observations, then emits human-readable or JSON diagnostics and an exit code.

flowchart TD
A[Gateway start CLI] --> B[Managed service activation]
B --> C[Service health waiter]
B --> D[HTTP readiness waiter]
C --> E[Lifecycle result handling]
D --> E
E --> F[Shared failure formatter]
F --> G[CLI output and exit code]
Loading

Technical review

Best possible solution:

Reuse the shared formatter for failed service observations while retaining an HTTP-specific timeout with the actual overall duration when service health has already succeeded.

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

Source establishes the reported generic-timeout path and the introduced HTTP-only duration regression; no target code or tests were executed during this read-only review.

Is this the best way to solve the issue?

Sharing the existing formatter is the smallest complete approach, provided the lifecycle caller distinguishes a failed service observation from a successful observation followed by an HTTP timeout.

Full review comments:

  • [P2] Use the HTTP wait duration when service health already succeeded — src/cli/daemon-cli/lifecycle.ts:385-389
    The two waiters run independently, and reaching this block does not imply that health failed. For example, a stopped channel can leave /readyz at 503 while RPC health succeeds after 1 second because channel runtime warnings do not fail that probe. HTTP readiness then waits through the 45-second deadline, but passing the successful snapshot to this formatter produces Gateway start timed out after 1s waiting for health checks. The base correctly attributed this case to the HTTP deadline. Use the shared formatter for failed service observations, retain HTTP-specific duration reporting when health.healthy is true, and add that mixed-result regression case.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 84795f2ec990.

Provenance checked

Testing

Proof path: unit tests only.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test src/cli/daemon-cli/lifecycle-readiness.test.ts src/cli/daemon-cli/restart-health-progress.test.ts src/cli/daemon-cli/restart-health-wait.test.ts --maxWorkers=1
  • node scripts/check-changed.mjs -- src/cli/daemon-cli/lifecycle.ts src/cli/daemon-cli/lifecycle-readiness.test.ts src/cli/daemon-cli/restart-health-diagnostics.ts
  • git diff --check

What I checked:

PR surface

Source -3, Tests +28. Total +25 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 14 17 -3
Tests 1 65 37 +28
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 79 54 +25

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Incorrect start diagnostics cause limited troubleshooting confusion without changing activation, readiness requirements, or exit status.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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 execution lanes are retired.

Reviewed November 1, 2026, 8:17 PM ET / November 2, 2026, 01:17 UTC.

This branch has not been deployed

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

Labels

cli CLI command changes P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants