Skip to content

fix(test): keep update broker transport on the host platform - #200411

Merged
vincentkoc merged 1 commit into
mainfrom
fix/test-update-platform-broker-20261117
Nov 17, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/test-update-platform-broker-20261117

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Update lifecycle tests that simulate Windows fail before exercising finalization: the real native broker receives a Windows named-pipe endpoint on a POSIX host.

User Impact

No runtime change. Restore tests of Windows task finalization while retaining real native broker and SQLite behavior.

Why This Change Was Made

Use the existing scoped host-platform fixture helper when the real broker creates its resource authority. Service control continues to use the simulated platform; endpoint selection follows the host running the child.

This is a maintainer-directed repair of failing main CI: https://github.com/openclaw/openclaw/actions/runs/44010442679/job/133796403563.

Evidence

  • On unchanged main bbf7f75, all three existing Windows task-finalization cases failed with EEXIST mkdir dot at broker startup, before any SQLite exchanges (12.72 seconds total on macOS).
  • Seven test-fixture lines added; no production changes or test removal.
  • Formatter and git diff --check passed; independent review and autoreview found no actionable P0–P3 issues.
  • Exact PR head: all 67 tests passed across Windows lifecycle, package lifecycle, service authority, and Git service suites (541.90 seconds including compilation). These exercise real broker/SQLite and cleanup; no cheaper mocked proof covers the host/simulated-platform boundary.
  • Local proof ran on macOS; the original CI failure ran Linux. Both use a real POSIX broker beneath simulated Windows service control.

@clawsweeper

clawsweeper Bot commented Nov 17, 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: XS labels Nov 17, 2026
@vincentkoc vincentkoc self-assigned this Nov 17, 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. labels Nov 17, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review November 17, 2026 04:52
@vincentkoc
vincentkoc enabled auto-merge (squash) November 17, 2026 04:54
@clawsweeper clawsweeper Bot added P2 Normal backlog priority 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 17, 2026
@clawsweeper

clawsweeper Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR keeps native broker endpoint selection on the actual host platform during simulated Windows update tests.

Example: Run Windows task-finalization tests on macOS with process.platform simulated as win32.

  • Before: The parent supplies a Windows named-pipe endpoint to a POSIX broker, which fails during directory creation.
  • After: The broker receives a POSIX socket endpoint while service control continues to simulate Windows.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused, correct fixture repair supported by source tracing and reported integration results; independent execution was outside this read-only review and affected CI remains pending.
Proof confidence 🦐 gold shrimp (3/6) This fixture-only repair changes no shipped entry point; the body reports base failures and exact-head passes through existing real broker/SQLite tests, which were not rerun during this review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Maintainers cannot exercise Windows task-finalization coverage on POSIX because fixture setup starts the broker with an incompatible endpoint.
Reason: The maintainer-authored repair follows established fixture ownership and restores meaningful existing coverage without production changes.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it repairs a concrete test-fixture platform mismatch still present on main, preserves existing assertions, and introduces no actionable defect.

Priority: P2
Reviewed head: 3d05b4ee41721f92d5140dd35ca5eca30d16c674

Before merge

None.

Findings

None.

Agent review details

How this fits together

The shared update-test lifecycle fixture connects simulated service control to real native broker and SQLite operations; broker resource-authority creation selects the endpoint passed to the child process.

flowchart TD
  A[Windows lifecycle tests] --> B[Shared lifecycle fixture]
  B --> C[Simulated Windows service control]
  B --> D[Scoped host platform]
  D --> E[Real resource authority]
  E --> F[Native broker socket]
  F --> G[SQLite operations]
Loading

Technical review

Best possible solution:

Retain the scoped call-through fixture repair so real broker transport follows the host without weakening Windows service assertions.

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

Source inspection establishes the mismatch between the simulated parent platform and real child platform; the PR reports matching base failures, but this read-only review ran no tests.

Is this the best way to solve the issue?

This is the smallest complete fix: reuse the existing synchronous host-platform scope at endpoint creation, restore the platform immediately, and retain real broker behavior and existing cases.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Focused introduced change: The pinned introduction diff adds only an import and a scoped call-through spy around resource-authority creation; production code and existing assertions remain unchanged. (src/cli/update-cli-lifecycle.test-support.ts:165, 3d05b4ee4172)
  • Concrete platform mismatch: Resource-authority creation branches on process.platform, while the real broker child derives its socket directory using its own platform and calls mkdir; a Windows pipe endpoint on POSIX yields the reported directory-creation failure. (src/process/spawn-broker/resource-authority.ts:11, 3d05b4ee4172)
  • Existing regression cases retained: The three task-finalization variants simulate win32 and assert actual task enablement outcomes; the repair lets these cases reach their existing assertions. (src/cli/update-cli.windows-lifecycle.test.ts:424, 3d05b4ee4172)
  • Established fixture intent: Commit a201d8d established host-platform scoping for real filesystem owners; commit 46fb97d extended it to SQLite header probes while preserving simulated service behavior. (src/cli/update-cli-lifecycle.test-support.ts:54, 46fb97d597d4)
  • Current main still needs the repair: Fetched main retains host scoping for SQLite probes but lacks the broker resource-authority spy. (src/cli/update-cli-lifecycle.test-support.ts:165, b4254cb2f6fa)
  • Validation and inspection limits: The body reports the three cases failing on the base and 67 affected tests passing on the exact head on macOS; live checks show successful lint and type checks with changed-test shards still running. The linked main job failed, but its redirected log host is blocked by the network allowlist. A deeper content-history search encountered unavailable local objects; available commit history and explicit fixture-intent commits establish the relevant design. (3d05b4ee4172)

PR surface

Tests +7. Total +7 across 1 file. Added test files: 0.

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

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: Repairs broken update-test coverage and CI without changing shipped runtime behavior.
  • 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: Repairs broken update-test coverage and CI without changing shipped runtime behavior.
  • 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 17, 2026, 12:07 AM ET / 05:07 UTC.

@vincentkoc
vincentkoc merged commit 029d2af into main Nov 17, 2026
211 of 212 checks passed
@vincentkoc
vincentkoc deleted the fix/test-update-platform-broker-20261117 branch November 17, 2026 05:11
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash auto-merge.

fuller-stack-dev added a commit that referenced this pull request Nov 17, 2026
…the socket directory (#200453)

The parent's resource authority decides whether the native resource
endpoint has a private socket directory. Since #200216 the broker child
re-derived that from its own platform and the endpoint's parent path. A
parent that selected a directory-less endpoint while the child ran on
POSIX therefore got `mkdir '.'` and EEXIST before readiness. Tests that
simulate Windows in the parent hit this on macOS and Linux until #200411
pinned their fixture's authority to the host platform.

Forward the authority whole in the broker bootstrap. The broker creates,
permissions, and removes exactly the directory it was given, or none,
and derives nothing. Attachments still carry only the endpoint and
secret.
RomneyDa added a commit that referenced this pull request Nov 17, 2026
(cherry picked from commit 029d2af)

Release adaptation: none. Exact qualification repair; original failure and focused proof retained in the release handoff.
Companion audit: existing consumers and prerequisite contracts are present-equivalent; no interface changes. Broader broker authority repair 22d5c87 is not applicable to this fixture-only batch.

Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 18, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 18, 2026
…the socket directory (openclaw#200453)

The parent's resource authority decides whether the native resource
endpoint has a private socket directory. Since openclaw#200216 the broker child
re-derived that from its own platform and the endpoint's parent path. A
parent that selected a directory-less endpoint while the child ran on
POSIX therefore got `mkdir '.'` and EEXIST before readiness. Tests that
simulate Windows in the parent hit this on macOS and Linux until openclaw#200411
pinned their fixture's authority to the host platform.

Forward the authority whole in the broker bootstrap. The broker creates,
permissions, and removes exactly the directory it was given, or none,
and derives nothing. Attachments still carry only the endpoint and
secret.
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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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