Skip to content

fix(test): stabilize native Gateway startup cancellation - #1606

Merged
RomneyDa merged 1 commit into
mainfrom
fix/native-gateway-dispose-startup-flake
Oct 2, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
fix/native-gateway-dispose-startup-flake

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Summary

  • give the native Gateway startup cancellation tests their own 10-second watchdog
  • retain the fixture's 300 ms deadline for the dedicated startup-timeout regression
  • prevent CI scheduler delay after the fake process spawn signal from winning the cancellation assertion

The failure in #1605 (fix(local-ai): make llama runtime validation deterministic) was a test race. The fake host signaled that startup had begun, but the test continuation could be delayed beyond the shared 300 ms startup timeout. The runtime then correctly reported TimeoutException before the test called DisposeAsync.

Required proof pools

  • none: this changes test scheduling only and does not change product behavior or a platform-specific runtime contract

Validation

Current head 74be31f2:

  • git diff --check: passed
  • dotnet test tests/OpenClaw.Connection.Tests/OpenClaw.Connection.Tests.csproj --no-restore --filter "FullyQualifiedName~NativeGatewayRuntimeTests": 56 passed, 0 failed
  • 30 repeated runs of both startup cancellation tests: 30/30 iterations passed
  • Shared test project build: passed with 0 warnings and 0 errors
  • Tray test project build: passed with 0 warnings and 0 errors
  • AutoReview (.agents/skills/autoreview/scripts/autoreview --mode local): clean, no accepted/actionable findings
  • GitHub Build and Test / Core and CLI tests: passed in 9m35s on Windows, including the full Connection suite
  • GitHub Build and Test / CI Gate (targeted): passed
  • CodeQL Actions and C# security: passed

The repository's full local Windows closeout remains unavailable on this macOS host: it cannot execute build.ps1 or the Windows API portions of Shared and Tray tests, and targeted CI did not select the unchanged Tray lane. Two Azure Crabbox native-Windows provisioning attempts also failed before a run URL was created:

  • provider azure, lease cbx_6296db2e5b5a, command crabbox warmup --provider azure --target windows --windows-mode normal --keep --idle-timeout 90m --ttl 240m --timing-json: blocked by low-priority quota and eastus capacity
  • provider azure, lease cbx_d6dda4b87712, command crabbox warmup --provider azure --target windows --windows-mode normal --class standard --keep --idle-timeout 90m --ttl 240m --timing-json: blocked by eastus capacity

Run URLs are unavailable because neither lease reached ready state.

Real behavior proof

The current-head full NativeGatewayRuntimeTests class passes 56/56. The two affected cancellation tests also passed 30 repeated process-level runs while the dedicated 300 ms timeout regression remained unchanged.

UI, MCP, and gateway invocation proof are not applicable because this PR changes only test timing. Rubber-duck review was skipped for the same reason.

@clawsweeper

clawsweeper Bot commented Oct 2, 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.

@RomneyDa RomneyDa added the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Oct 2, 2026
@clawsweeper clawsweeper Bot added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. 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 Oct 2, 2026
@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codex review: blocked before merge. Reviewed October 2, 2026, 9:28 AM ET / 13:28 UTC (Revision 2).

ClawSweeper review

What this changes

The PR gives two native Gateway startup cancellation tests a 10-second startup deadline while preserving the dedicated 300 ms timeout regression.

Merge readiness

⛔ Blocked before merge - 2 items remain

This remains a useful, focused test repair that current main does not contain. No introduced correctness defect was found, and the member-authored PR is protected from automatic closure.

Priority: P3
Reviewed head: 74be31f24861a679640b6f33fb8407bea212f60c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, sound test repair with successful targeted validation and an explicitly documented Windows closeout gap.
Proof confidence 🌊 off-meta tidepool Not applicable: This member-authored, test-only change has no production behavior proof gate. Reported focused and repeated runs exercise the changed scheduling; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored, test-only change has no production behavior proof gate. Reported focused and repeated runs exercise the changed scheduling; no stored-data contract changes.
Evidence reviewed 6 items Pinned introduced change: The complete introduced patch changes only the runtime-test factory and two cancellation tests. Cancellation, disposal, and restart-rejection assertions remain intact.
Race mechanism and retained timeout coverage: Startup polls with a 100 ms delay and throws when its configured deadline expires. The cancellation tests previously shared a 300 ms deadline; the separate Timeout_CleansUpChild test still uses that fixture deadline. Production's two-minute startup default is unchanged.
Current-main necessity: The fetched main revision retains the original 300 ms cancellation-test setup. Merged #1605 (fix(local-ai): make llama runtime validation deterministic) addresses Local AI validation, not this test race; it is not a replacement.
Findings None None.
Security None None.

How this fits together

Companion's native Gateway runtime starts and stops an owned Gateway process. These tests use a fake process host to verify cancellation, process cleanup, and restart rejection.

flowchart TD
    A[Test requests startup] --> B[Native Gateway runtime]
    B --> C[Fake process host]
    C --> D[Listener remains unavailable]
    D --> E[Stop or dispose request]
    E --> B
    B --> F[Cancellation and cleanup assertions]
Loading

Before merge

  • Resolve merge risk (P1) - The required full Windows build and Shared/Tray test closeout have not been recorded for this head; project builds and targeted CI do not cover the complete required subset.
  • Complete next step (P2) - Run and record ./build.ps1 plus the required Shared and Tray tests on Windows at the current head, ensuring tests actually execute.
Agent review details

Security

None.

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep cancellation tests independent of the short timeout regression, preserving all cleanup assertions and completing the repository's Windows validation subset.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep cancellation tests independent of the short timeout regression, preserving all cleanup assertions and completing the repository's Windows validation subset.

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

No deterministic reproduction was established during this review. Source shows how scheduler delay beyond 300 ms can let timeout precede the test's stop or dispose request.

Is this the best way to solve the issue?

Yes. Separate cancellation-test deadlines preserve the existing assertions without weakening the dedicated timeout regression or changing production defaults.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is a bounded test-reliability repair with no production behavior change.
  • 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: This member-authored, test-only change has no production behavior proof gate. Reported focused and repeated runs exercise the changed scheduling; no stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • Karen: Raw commit dba8121 adds tests/OpenClaw.Connection.Tests/NativeGatewayRuntimeTests.cs:347 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: dba81213371c; files: tests/OpenClaw.Connection.Tests/NativeGatewayRuntimeTests.cs)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record the full Windows build and required Shared/Tray test results for the current head.

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-10-02T13:15:47.663Z sha 74be31f :: needs maintainer review before merge. :: none

@RomneyDa RomneyDa removed the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Oct 2, 2026
@RomneyDa
RomneyDa merged commit bb4ac51 into main Oct 2, 2026
29 checks passed
@RomneyDa
RomneyDa deleted the fix/native-gateway-dispose-startup-flake branch October 2, 2026 13:31
RomneyDa added a commit to RomneyDa/openclaw-windows-node that referenced this pull request Oct 16, 2026
Includes the canonical fix from openclaw#1606 for the failed startup-disposal test. The Gateway-aligned alpha feature remains unchanged relative to main.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant