Skip to content

fix: make Linux adapter wiring tests portable on Windows - #120741

Merged
steipete merged 1 commit into
mainfrom
codex/windows-current-main-b518-tests
Aug 8, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/windows-current-main-b518-tests

Conversation

@steipete

@steipete steipete commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where Windows contributors running the process supervisor adapter tests would get Linux-only wiring failures because the tests probed the Windows host for /bin/sh while simulating Linux.

Why This Change Was Made

The test fixture now models Linux shell availability at the filesystem boundary and reloads the PTY adapter only while that fixture is active. The spy is restored and Vitest's evaluated-module cache is reset in finally, so the non-isolated suite cannot leak forced host behavior or the memoized Linux shell result. The earlier cross-platform signal test uses Darwin, which still covers the intended non-Windows production branch without priming Linux-only state.

This is deliberately test-only. It does not skip Windows coverage, weaken assertions, change production behavior, add configuration, or alter dependencies.

User Impact

Windows contributors and CI can run the Linux adapter wiring coverage reliably. There is no runtime behavior change for OpenClaw operators.

Evidence

  • Exact candidate: b2210c8270d1d818953a9d7890781bde1e80b337 (parent b5180b68163a0dec24ac7615b81e7f12aadbd5e2)
  • Native Windows focused proof: 3 files, 55/55 tests passed via node scripts/run-vitest.mjs src/process/supervisor/adapters/child.test.ts src/process/supervisor/adapters/pty.test.ts src/process/linux-oom-score.test.ts
  • Targeted oxfmt --check: passed for all three changed files
  • git diff --check HEAD^ HEAD: passed
  • Current-main audit at 08d2062c7f6027fa5d99493247ae3abb3fb29364: all three parent blobs are byte-identical to main; clean three-way merge; no rebase required
  • Duplicate audit: no semantic duplicate among open PRs; fix(process): detach service-managed tool children on Linux (#120386) #120398 touches a separate child.test.ts service-detach section and leaves these hunks intact
  • Autoreview: TruffleHog clean; Codex returned no findings, patch correct, confidence 0.99 on a synthetic commit whose before/after blob hashes and stable patch ID exactly match this commit
  • Two independent owner/sibling reviews: clean after preserving the accepted spy-restoration and fresh-dynamic-import isolation fixes
  • LOC: production +0/-0; tests/support +27/-2

Contributor credit: Peter Steinberger (steipete).

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Aug 8, 2026
@steipete
steipete marked this pull request as ready for review August 8, 2026 22:53
@steipete

steipete commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@steipete

steipete commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added 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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 8, 2026
@clawsweeper

clawsweeper Bot commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 8, 2026, 7:47 PM ET / 23:47 UTC.

ClawSweeper review

What this changes

The PR makes Linux-specific supervisor adapter tests simulate /bin/sh and isolate cached modules so they run on Windows hosts.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No blocking findings. This focused test-only repair remains needed on current main and should receive routine maintainer review rather than closure or an automated repair lane.

Priority: P3
Reviewed head: b2210c8270d1d818953a9d7890781bde1e80b337
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is focused, cleanly isolates non-isolated test state, and has relevant Windows validation without changing runtime behavior.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored test-only PR is outside the external-contributor real-behavior-proof gate; exact-head Windows CI and the reported native Windows focused run supply relevant validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored test-only PR is outside the external-contributor real-behavior-proof gate; exact-head Windows CI and the reported native Windows focused run supply relevant validation.
Evidence reviewed 5 items Owner-boundary behavior: The Linux OOM wrapper probes and memoizes /bin/sh availability only for Linux; the child and PTY adapters consume that decision when constructing processes. The fixture targets this producer boundary rather than changing production behavior.
Isolation repair: The patch scopes the filesystem spy, imports the PTY adapter only after resetting evaluated modules, and restores both the spy and module state in finally blocks; this matches the non-isolated test suite's lifecycle needs.
Current-main comparison: All three touched current-main blobs match the PR parent, so the Windows portability repair is not already implemented on main.
Findings None None.
Security None None.

How this fits together

The process supervisor selects child or PTY adapters for tool processes. Tests simulate a Linux platform and shell availability to verify the adapters apply the Linux OOM-score wrapper correctly.

flowchart LR
  Host[Windows or Linux test host] --> Fixture[Platform and shell fixture]
  Fixture --> Cache[Linux shell availability cache]
  Cache --> Adapter[Child or PTY adapter]
  Adapter --> Test[Adapter wiring test]
  Test --> Result[Portable assertions]
Loading

Decision needed

Question Recommendation
Should a maintainer merge this test-only Windows portability repair after the normal exact-head review? Merge after routine review: Accept the focused test-only isolation repair, supported by the successful Windows check and clear ownership boundary.

Why: The PR carries the protected maintainer label and is maintainer-authored, so this workflow must leave the final merge decision to a human despite a clean technical review.

Before merge

  • Complete next step (P2) - No repair lane is needed because the PR already contains the focused implementation; only protected maintainer review remains.
Agent review details

Security

None.

PR surface

Source +17, Tests +8. Total +25 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 17 0 +17
Tests 2 10 2 +8
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 27 2 +25

Review metrics

Metric Value Why it matters
Production versus test LOC production +0/-0; tests/support +27/-2 (net +25) The change adds only test-host simulation and cleanup, with no runtime, configuration, dependency, or permission growth.

Technical review

Best possible solution:

Merge the scoped test-boundary fixture and cache isolation after normal maintainer sign-off, preserving production shell detection unchanged.

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

Yes, at source level: current main simulates Linux while the OOM helper reads the real host /bin/sh and memoizes that result; the supplied exact-head Windows check and native focused run support the reported failure path.

Is this the best way to solve the issue?

Yes. Mocking shell availability at the filesystem owner boundary and resetting the evaluated module cache is narrower and safer than adding a production cache-reset API or disabling the production cache.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 019dd0e08659.

Labels

Label justifications:

  • P3: This improves contributor and CI test portability without changing OpenClaw operator runtime behavior.
  • 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 maintainer-authored test-only PR is outside the external-contributor real-behavior-proof gate; exact-head Windows CI and the reported native Windows focused run supply relevant validation.

Evidence

What I checked:

  • Owner-boundary behavior: The Linux OOM wrapper probes and memoizes /bin/sh availability only for Linux; the child and PTY adapters consume that decision when constructing processes. The fixture targets this producer boundary rather than changing production behavior. (src/process/linux-oom-score.ts:42, 019dd0e08659)
  • Isolation repair: The patch scopes the filesystem spy, imports the PTY adapter only after resetting evaluated modules, and restores both the spy and module state in finally blocks; this matches the non-isolated test suite's lifecycle needs. (src/process/supervisor/adapters/pty.test.ts:317, b2210c8270d1)
  • Current-main comparison: All three touched current-main blobs match the PR parent, so the Windows portability repair is not already implemented on main. (src/process/supervisor/adapters/child.test.ts:743, 019dd0e08659)
  • History and routing: Current-line blame and nearby process-adapter history identify Peter Steinberger as the strongest recent owner signal; the related Linux service-detachment PR changes production child lifecycle behavior and is distinct from this test-only portability repair. (src/process/supervisor/adapters/child.test.ts:743, 8c059f95c51)
  • Exact-head validation: The supplied PR checks include a successful Windows Node test, and the PR body reports a native Windows focused run with 55 passing tests; no runtime surface changed. (src/process/supervisor/adapters/test-support.ts:15, b2210c8270d1)

Likely related people:

  • steipete: Current-line history and the Linux OOM-score/adapter work both point to Peter Steinberger beyond authorship of this PR. (role: recent area contributor; confidence: high; commits: b2210c8270d1, 8c059f95c51; files: src/process/linux-oom-score.ts, src/process/supervisor/adapters/child.test.ts, src/process/supervisor/adapters/pty.test.ts)
  • Vincent Koc: History identifies Vincent Koc with the shared supervisor signal/wait test assertions used by these adapter suites. (role: adjacent test contributor; confidence: medium; commits: e1e20c42; files: src/process/supervisor/adapters/test-support.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-08T23:41:18.439Z sha b2210c8 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 5400311 into main Aug 8, 2026
160 checks passed
@steipete
steipete deleted the codex/windows-current-main-b518-tests branch August 8, 2026 23:48
@steipete

steipete commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 9, 2026
Punchcard-Session: amber-workshop-workshop-36

* origin/main: (28 commits)
  perf(doctor): keep bundled doctor contract closures dependency-light (#120698)
  fix(elevenlabs): preserve repeated committed speech segments (#120792)
  fix(ai): fence Responses replay metadata (#120777)
  fix(ai): invalidate stale compaction replay (#120786)
  fix(telegram): clean up every failed webhook startup phase (#120788)
  fix(codex): preserve configured MCP tools in scheduled turns (#120366)
  fix(ui): show dev checkout commit lag in Updates (#120769)
  fix(agents): repair XML-polluted tool names (#113814)
  fix(discord): remove only the bot own reactions (#120785)
  fix(macos): complete ChatGPT subscription setup (#120782)
  fix(plugins): surface safe administrator install warnings (#120783)
  fix(release): keep upgrade survivor sessions fresh (#120778)
  fix(providers): preserve realtime tool-result delivery ownership (#120776)
  fix(plugins): retain incognito scope for embedded session ownership (#120215)
  fix(elevenlabs): surface realtime provider error events (#120772)
  fix(agents): preserve exact steering delivery ownership (#120770)
  fix(telegram): prevent session-count routing slowdown (#120774)
  fix(agents): preserve authoritative background process outcomes (#120754)
  test(process): make Linux adapter wiring portable (#120741)
  fix(diagnostics-prometheus): send Content-Length on metrics HEAD responses (#120212)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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.

2 participants