Skip to content

fix(test): released-Gateway Dashboard proof fails when the job's first Edge launch is slow - #2140

Merged
bkudiess merged 1 commit into
openclaw:mainfrom
bkudiess:bkudiess-e2e-edge-cold-start
Nov 13, 2026
Merged

bkudiess merged 1 commit into
openclaw:mainfrom
bkudiess:bkudiess-e2e-edge-cold-start

Conversation

@bkudiess

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes: the released-Gateway search/Dashboard E2E proof fails on main when the job's first headless Edge launch takes longer than 30 seconds to answer its first page command.

User Impact

No product change. CI no longer fails this proof when the hosted runner's first (cold) Edge start is slow, and any future startup failure reports how long each startup stage took.

Why This Change Was Made

main run 43346981281 failed ReleasedGateway_SearchDenialAndDashboardRoutes with Edge startup failed at page Network.enable; elapsedMs=31265; process=running; failure=TaskCanceledException. The endpoint, page discovery and page WebSocket stages had all succeeded, and Edge was still running. A warm Edge launch later in the same job was ready in 1.8 s.

All four startup stages shared one 30-second budget. Across 75 passing setup/connect runs since #2049, the job's first (cold) Edge launch took 1.8-3.5 s typically, with a tail of 8.9, 13.5, 14.4 and 16.1 s. Later (warm) launches took 0.4-2.1 s. On a page target, Network.enable is answered only once that page's renderer is live, and no earlier readiness event exists to await. This was the only failure at this stage in 76 runs; the earlier failures were the DevToolsActivePort sharing violation fixed by #2049.

This change:

  • Gives startup its own named 60-second hang guard, overridable with OPENCLAW_E2E_EDGE_STARTUP_TIMEOUT_SECONDS (1-3600; other values keep the default). Per-command operations keep their 30-second bound. No retries are added.
  • Reports cumulative per-stage milliseconds (endpoint, page, socket, network) and the stderr character count on every startup, and adds the limit to failures. Only numbers and fixed labels are logged, never raw Edge output, URLs or paths.

Limit: the failing launch's real duration is unknown (it was cancelled at 31 s), so this widens a hang guard to about 3.7 times the slowest observed passing cold start rather than proving the failure would have finished. If it recurs, the new stage timings show whether the cause is slow or stuck. Candidate follow-ups if they show slow cold starts: Edge flags that reduce first-launch background work, and logging how many about:blank page targets matched.

Evidence

  • 75 passing setup/connect artifacts (2026-11-11 to 2026-11-12) were parsed for Edge page CDP ready in timings; the failing run is the only Network.enable stage failure since fix(test): Edge startup intermittently blocks Gateway route proof #2049.
  • New parsing tests cover the override (unset, empty, zero, negative, whitespace, exponent, 3600, 3601 and int.MaxValue).
  • Hanselman dual-model review (Claude Opus 5.5 and GPT-6 Astra, high effort). Both flagged that oversized overrides would throw inside startup and blame Edge (fixed with the 1-3600 cap). Opus also asked for the stderr count on success and a docs update (both done). The delta review from both reported no remaining CRITICAL, HIGH, MEDIUM or LOW issues.
  • Real Edge proof comes from this PR's hosted setup/connect run. The local native Edge smoke was not run because this host's Edge policy forces corporate sign-in, which is not representative of the runner.

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Docs or instructions
  • Tests or validation
  • Security hardening
  • Chore or infrastructure

Scope

  • Tray or WinUI UX
  • Windows node capability
  • Local MCP or winnode
  • Gateway, connection, or pairing
  • Setup or onboarding
  • Permissions, privacy, or security
  • Tests, CI, or docs

Required proof pools

  • windows-wsl-gateway-e2e: the changed helper runs only in the hosted setup/connect lane's released-Gateway Dashboard proof and its Edge startup smoke.

Validation

Run locally on 6ddc13b8 plus this exact diff (committed unchanged as caa9f91d):

  • ./build.ps1: passed.
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: 5849 passed, 0 failed, 29 skipped. An earlier run that overlapped with other local builds had 2 failures in untouched tests (UploadRetentionCoordinatorTests 10 s timeout and an MxcFolderAdmissionTests host-path access denial); both passed in isolation (83/83) and in this clean full rerun.
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj: 6359 passed, 0 failed.
  • dotnet test ./tests/OpenClaw.E2ETests/OpenClaw.E2ETests.csproj -r win-x64 --filter "FullyQualifiedName~SetupAndConnectTestsBrowserStartup|FullyQualifiedName~GatewaySearchBrowserProofTests": 29 passed, 1 skipped (native Edge smoke, gated by OPENCLAW_RUN_E2E).
  • ./scripts/validate-docs.ps1: passed (73 Markdown files). git diff --check: clean.

Real Behavior Proof

  • Environment tested: local Windows dev host (managed tests); hosted windows-latest setup/connect lane for runtime proof.
  • PR head or commit tested: caa9f91d89ce32600519516abccd09d202815b83 (local runs used the identical uncommitted tree on 6ddc13b8).
  • Exact steps or command run: hosted Setup and connect E2E (WSL Latest) on this PR, which runs ReleasedGateway_SearchDenialAndDashboardRoutes and OwnedEdgePageSupportsEvaluationAndScreenshotWithoutAGateway.
  • Evidence after fix: pending this PR's hosted run; its console log should show Edge page CDP ready in <n>ms (stageMs=endpoint:..,page:..,socket:..,network:..; stderrCharacters=..).
  • Observed result: before the fix, Edge startup failed at page Network.enable; elapsedMs=31265; process=running; stderrCharacters=2415; failure=TaskCanceledException (run 43346981281).
  • Screenshot or artifact links verified? (Yes/No/N/A): N/A
  • Not verified or blocked: the slow cold start is intermittent (1 in 76 runs) and was not reproduced; a green run shows the path works, not that the slow case was hit. Local native Edge proof is not representative on this host.

Security Impact

  • New permissions or capabilities? (Yes/No): No
  • Secrets or tokens handling changed? (Yes/No): No
  • New or changed network calls? (Yes/No): No
  • Command or tool execution surface changed? (Yes/No): No
  • Data access scope changed? (Yes/No): No
  • If any answer is Yes, explain the risk and mitigation: N/A. Test-only; new log fields are numbers and fixed stage labels.

Compatibility and Migration

  • Backward compatible? (Yes/No): Yes
  • Config or environment changes? (Yes/No): Yes
  • Migration needed? (Yes/No): No
  • If yes, list the exact upgrade steps: none required. The optional test-only OPENCLAW_E2E_EDGE_STARTUP_TIMEOUT_SECONDS (1-3600) overrides the 60 s Edge startup guard.

Review Conversations

  • I replied to or resolved every bot review conversation addressed by this PR.
  • I left unresolved only conversations that still need maintainer judgment.

…t Edge launch is slow

The search/Dashboard E2E proof failed on main (run 43346981281) with
"Edge startup failed at page Network.enable; elapsedMs=31265". Endpoint,
page discovery and WebSocket connect had succeeded and Edge was running.
All four startup stages shared one 30 s budget, while the job's first
(cold) Edge launch measured 1.8-16.1 s across 75 passing runs.

Give startup its own named 60 s hang guard, overridable with
OPENCLAW_E2E_EDGE_STARTUP_TIMEOUT_SECONDS (1-3600), keep 30 s for
per-command operations, and report cumulative per-stage milliseconds and
the stderr character count on success and failure so a slow stage can be
told apart from a hang. No retries.

Co-authored-by: Copilot App <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

🦞👀
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.

@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 priority bug or improvement 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. 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 13, 2026
@clawsweeper

clawsweeper Bot commented Nov 13, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

This PR separates Edge startup from the command timeout, adds a bounded startup override, and records sanitized startup timings.

Example: The reported hosted Edge launch still awaited Network.enable after 31,265 milliseconds.

  • Before: The shared 30-second startup budget cancelled the browser proof.
  • After: Startup can wait up to 60 seconds by default and reports completed-stage timings; whether that particular launch would finish remains unknown.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused and source-correct, with reported passing local validation; current-head hosted execution and elimination of the intermittent timeout are not yet established.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored change affects only the E2E adapter and tests; shipped-entry-point proof is not required, and the declared hosted browser validation is still running.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Developers lose released-Gateway Dashboard validation when Edge startup exhausts the command-sized timeout before route proof begins.
Reason: The maintainer-authored direction is established, and every hunk supports a bounded harness repair or its diagnostics, documented override, and parsing coverage.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR provides a focused test-harness repair absent from current main, with no actionable correctness or security findings.

Priority: P2
Reviewed head: caa9f91d89ce32600519516abccd09d202815b83

Before merge

None.

Findings

None.

Agent review details

How this fits together

The setup/connect E2E harness launches an isolated Edge process, discovers its loopback debugger, and uses page CDP to authenticate, inspect Dashboard routes, and capture screenshots.

flowchart LR
A[Setup connect E2E] --> B[Owned Edge process and profile]
B --> C[Loopback debugger discovery]
C --> D[Page CDP startup budget]
D --> E[Released Gateway Dashboard]
E --> F[Authentication and route assertions]
Loading

Technical review

Best possible solution:

Keep the separate bounded startup budget and sanitized timings in the existing adapter while preserving strict route assertions and owned-resource cleanup.

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

The reported main failure and existing shared deadline identify the timeout path, but the intermittent slow launch was not reproduced and its eventual completion remains unknown.

Is this the best way to solve the issue?

This is a proportionate guard adjustment with measured justification: it retains one startup owner, adds no retry, and preserves downstream assertions without claiming to establish why Edge stalled.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Startup and command deadlines changes intended behavior with a stated reason (4ea07e8: The original adapter bounded CDP operations at 30 seconds; fix(test): Edge startup intermittently blocks Gateway route proof #2049 explicitly retained that budget while simplifying browser startup.)
  • Sanitized startup diagnostics keeps the original intent (d6f8a88: The previous repair exposed startup stage, elapsed time, process state and stderr character count without retaining browser output or credential-bearing URLs.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

Likely related people:

  • Barbara Kudiess: Raw commit 4ea07e8 adds tests/OpenClaw.E2ETests/Setup/GatewaySearchBrowserProof.cs:34 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 4ea07e858b81; files: tests/OpenClaw.E2ETests/Setup/GatewaySearchBrowserProof.cs)
  • Karen: Raw commit d6f8a88 adds tests/OpenClaw.E2ETests/Setup/GatewaySearchBrowserProof.cs:84 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d6f8a885361c; files: tests/OpenClaw.E2ETests/Setup/GatewaySearchBrowserProof.cs)

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: Improves an existing hosted validation failure with limited blast radius and no product runtime change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Improves an existing hosted validation failure with limited blast radius and no product runtime change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 12, 2026, 9:51 PM ET / November 13, 2026, 02:51 UTC.

@bkudiess
bkudiess merged commit 20d8514 into openclaw:main Nov 13, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant