Skip to content

fix(gateway): scope crash loop channel recovery hints - #129697

Merged
steipete merged 1 commit into
mainfrom
codex/qa-gateway-crash-loop-profile-hints-20260825
Aug 26, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa-gateway-crash-loop-profile-hints-20260825

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes Gateway crash-loop channel recovery instructions targeting the wrong default Gateway when the operator uses an active named profile or container. Following the displayed command previously left the intended channel disconnected.

Why This Change Was Made

The crash-loop diagnostic owner hard-coded an unscoped openclaw command even though the existing canonical CLI formatter already carries profile/container context. The repair reuses that formatter and removes a duplicated target-versus-placeholder serialization branch, keeping production code net neutral.

User Impact

Operators can copy the displayed manual channel-start command directly; it now addresses the actual active Gateway, preserves channel/account parameters, and respects the established container-over-profile precedence.

Evidence

  • Authentic production-owner regressions failed for named profiles, active containers, and simultaneous profile/container context before repair.
  • All 197 focused infra, CLI-formatting, and real Gateway channel-lifecycle tests pass across three suites.
  • Exact owner command output preserves default context, placeholder/channel/account targeting, and container precedence.
  • Production code is net neutral; formatting, type-aware lint, and fresh independent structured P1 autoreview pass.

@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Aug 26, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 26, 2026
@clawsweeper

clawsweeper Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 8:55 PM ET / August 26, 2026, 00:55 UTC.

ClawSweeper review

What this changes

The PR makes Gateway crash-loop recovery hints emit a manual channel-start command for the active named profile or container.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

The recovery hint is still needed: current main hard-codes an unscoped command, while this patch delegates to the established CLI formatter and covers profile/container precedence. It is maintainer-authored and labeled for maintainer handling, so it remains open for the ordinary exact-head merge decision.

Priority: P1
Reviewed head: d712b5e3c3a844ad9b9059a2cbb0c32afba0d2ee

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-neutral repair with source-backed regression coverage and no actionable review finding.
Proof confidence 🌊 off-meta tidepool Not applicable: Not applicable: this is maintainer-authored; the PR body reports focused Gateway/CLI validation, while exact-head CI remains the normal merge gate.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Not applicable: this is maintainer-authored; the PR body reports focused Gateway/CLI validation, while exact-head CI remains the normal merge gate.
Evidence reviewed 6 items Recovery-hint implementation: The patch creates one JSON parameter object and passes the displayed command through the canonical CLI formatter before composing the operator hint.
Current-main gap: Current main still formats this recovery hint with an unscoped literal openclaw, so the central bug is not already implemented there.
Formatter contract: The established formatter validates container hints, uses profile context only when no container is active, and inserts root options before the gateway command.
Findings None None.
Security None None.

Live Verification

Command: pnpm openclaw --help

Result: PASS (completed)

$ node scripts/run-node.mjs --help
[openclaw] Building TypeScript (dist is stale: missing_build_stamp - build stamp missing).
[openclaw] Building bundled plugin assets.
[canvas] build: node scripts/bundle-a2ui.mjs
[log] ‹DIR›/a2ui.bundle.js  chunk │ size: 399.96 kB
[log] ‹DIR›/a2ui-v0.9.bundle.js  chunk │ size: 615.66 kB
[log]
[success] rolldown v1.2.0 Finished in 120.97 ms
[diffs] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts curated
[diffs-language-pack] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts full
[discord] build: node --import tsx ../../scripts/build-discord-activity-sdk.mts
[tsdown-build] invocation 1/2 finished in 0.8s
node_modules/playwright-core/lib/coreBundle.js (65821:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65821:29 ]
       │
 65821 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/playwright-core/lib/coreBundle.js (65828:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65828:29 ]
       │
 65828 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2343:30) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2343:31 ]
      │
 2343 │           ASM_CONSTS[start] = eval(func);
      │                               ──┬─
      │                                 ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2366:32) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2366:33 ]
      │
 2366 │           moduleExports[name] = eval(func);
      │                                 ──┬─
      │                                   ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

[tsdown-build] invocation 2/2 finished in 14.9s
[plugin-control-plane-loads] verified 35 built modules with native require and checked doctor closures
runtime-postbuild: 11 phases completed in 4547ms (slowest: built plugin control-plane loads 3716ms)

OpenClaw 2026.8.1 (d712b5e) — All your chats, one OpenClaw.

Usage: openclaw [options] [command]

Options:
  --container ‹name›   Run the CLI inside a running Podman/Docker container named ‹name› (default: env OPENCLAW_CONTAINER)
  --dev                Dev profile: isolate state under ~/.openclaw-dev, default gateway port 19001, and shift derived ports (browser/canvas)
  -h, --help           Display help for command
  --log-level ‹level›  Global log level override for file + console (silent|fatal|error|warn|info|debug|trace)
  --no-color           Disable ANSI colors
  --profile ‹name›     Use a named profile (iso
… output truncated …

Assertions:

  • PASS expect_output: Usage:

How this fits together

Gateway boot detects repeated failed starts and suppresses automatic channel startup so an operator can recover safely. Its diagnostic hint is copied into the OpenClaw CLI, which routes the channel-start request to the selected Gateway.

flowchart LR
A[Gateway boot] --> B[Crash-loop breaker]
B --> C[Recovery hint]
C --> D[CLI context formatter]
D --> E[Scoped channel-start command]
Loading

Before merge

  • Complete next step (P2) - No repair lane is needed: source review found no actionable defect, and this protected maintainer PR should proceed through normal exact-head CI and merge review.
Agent review details

Security

None.

PR surface

Source 0, Tests +22. Total +22 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 7 7 0
Tests 1 23 1 +22
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 30 8 +22

Review metrics

Metric Value Why it matters
Production versus test LOC production +0, tests +22 The bug repair replaces the duplicate command assembly with the existing formatter and adds four scoped-context regression cases.

Stored data model

Persistent data-model change detected: serialized state: src/infra/gateway-boot-lifecycle.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Land the formatter-based repair once the exact PR head has the required green checks, so every crash-loop recovery hint targets the active Gateway consistently.

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

Yes—current main's source hard-codes an unscoped command while the existing formatter maps active profile or container context to CLI root flags; the focused test table expresses the failing cases.

Is this the best way to solve the issue?

Yes—the patch removes local command-context assembly and reuses the canonical formatter that already owns validation and container-over-profile precedence.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 0036788055b5.

Labels

Label justifications:

  • P1: A crash-loop recovery command aimed at the wrong Gateway can leave the intended channel disconnected during operator recovery.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Not applicable: this is maintainer-authored; the PR body reports focused Gateway/CLI validation, while exact-head CI remains the normal merge gate.

Evidence

What I checked:

Likely related people:

  • steipete: Git history identifies Peter Steinberger as author of the original crash-loop channel-autostart recovery work and of this focused follow-up. (role: feature owner and recent area contributor; confidence: high; commits: ec7e5dd7699b, d712b5e3c3a8; files: src/infra/gateway-boot-lifecycle.ts, src/gateway/server-channels.ts)
  • Vincent Koc: History shows nearby crash-loop lifecycle maintenance in the same owner module. (role: adjacent recent contributor; confidence: medium; commits: f6e874835c60; files: src/infra/gateway-boot-lifecycle.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-26T00:13:39.281Z sha d712b5e :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 6b02b00 into main Aug 26, 2026
209 checks passed
@steipete
steipete deleted the codex/qa-gateway-crash-loop-profile-hints-20260825 branch August 26, 2026 03:14
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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