Skip to content

test: make the local pnpm test gate green on macOS hosts#100069

Merged
steipete merged 4 commits into
mainfrom
claude/clever-taussig-71cd25
Jul 4, 2026
Merged

test: make the local pnpm test gate green on macOS hosts#100069
steipete merged 4 commits into
mainfrom
claude/clever-taussig-71cd25

Conversation

@steipete

@steipete steipete commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

pnpm test could not go green on a clean macOS checkout of main (Linux CI green on the same SHA), which breaks the scripts/pr prepare-run local gate for every PR landed from a maintainer Mac (#100025). Beyond the two deterministic infra failures in the issue, full-suite runs on macOS failed 13 of 89 shards with a different subset each run.

Fixes #100025. Supersedes #100026 with fixture-layer fixes (details below).

Why This Change Was Made

Triage of full-suite runs on a Darwin 25.5 / Node 24 host reduced every failure to one of three classes, all test-environment bugs (no production behavior was wrong):

  1. Host dependence (deterministic on macOS)

    • macOS os.tmpdir() sits behind the /var -> /private/var symlink while production realpaths state/session/media paths. Any test that intercepts or compares fs paths by equality breaks. Fixed at the source: the shared fixture helpers (src/test-helpers/temp-dir.ts, src/test-utils/openclaw-test-state.ts, src/test-utils/fixture-suite.ts) now canonicalize their roots with fs.realpath after mkdtemp (identity on Linux). This fixes backup-create late-SQLite guard tests and all three store.pruning.integration repair tests without per-test patches. (The same class in the qqbot scoped-media tests was fixed independently on main in 7a92c47 while this branch was in flight; this PR rebases onto it.)
    • exec-approvals-analysis resolved the host python3 (Homebrew's python@3.x path triggers quoting). The test now resolves from a fixture PATH via the existing makeTempDir/makeExecutable/makePathEnv helpers and asserts exact equality — also fixing Windows hosts, where the old regex broke on python3.exe.
    • logs-cli asserted a rendered timestamp that follows the host time zone (host here runs Europe/London, hence +01:00). The test now pins withTimeZone("UTC", ...) like its siblings.
  2. Process-spawn races under parallel-suite load

    • The forking no-output scripts (src/test-utils/process-tree.ts) now emit one readiness byte on stderr after writing the pid file; both consumers (install-policy, secrets/resolve) use a rolling no-output timer that re-arms on output, so the killing silence window now starts strictly after the pid exists. Budgets raised from 150ms (lost to shell spawn latency under load) to 1s/10s.
    • prepare-extension-package-boundary-artifacts, dev-tooling-safety, and secret-provider-integrations: pid-file waits now require non-empty content (a reader between open(O_CREAT) and write saw an empty pid file → parseInt("") = NaN), sibling "delayed-fail" steps are sentinel-gated on the descendant's pid/ready file instead of a 150ms timer, and the group-kill test's step timeout leaves room for two Node boots.
    • crabbox-wrapper DELETE_CWD_ONCE fake: the restore-wait deadline is a fail-safe (the wrapper normally kills the child mid-loop); raised 1s → 10s so wrapper timer starvation can't make the child exit 66 before the wrapper reacts.
    • codex run-attempt.turn-watches: the terminal-idle delay is real-clock derived (timeout - elapsed), so exact equality loses a same-millisecond race under load (observed 1799999 vs 1800000); asserted within a bounded window instead. The "times out promptly" case had a 200ms overall attempt cap that startup could eat under load — promptness is proven by the 5ms completion-idle promptError, so the cap is now generous.
  3. Cross-file leaks in shared vitest workers (isolate: false)

    • server-reload-handlers: gateway test helpers set OPENCLAW_SKIP_CHANNELS/OPENCLAW_SKIP_PROVIDERS at module load; a leaked value routes reloads into the skip branch. Added the same documented beforeEach guard server-aux-handlers.test.ts already uses.
    • gateway run --token exports credentials into process.env as a production side effect; run.option-collisions now snapshots/clears them (polluter side) and run-main.exit clears them per test (victim side) — a leaked tok_run changed gateway preflight auth.
    • imessage monitor.watch-subscribe-retry: sibling suites install the imessage runtime singleton without clearing it; a leaked runtime resurrects another file's recovery cursor and watch.subscribe gains an unexpected since_rowid. The test now clears the singleton in beforeEach.

Supersedes #100026: that PR loosens the Windows-render regex (still host-dependent), adds a second compare path to the backup spy, patches two pruning expectations, and adds a paths.ts realpath-parent fallback for missing files. With fixture roots canonicalized, all of those tests pass without per-test patches and without the production change, so the fixture-layer fix is preferred (main stays lean; no prod diff in this PR).

Known remaining (out of scope): src/gateway/server-startup-log.test.ts ("blocked channel plugin" warnings) can still flip under worker sharing — the mock on plugin-registry is bypassed when the dynamically imported blocker chain was cached by another file, and the real registry then sees the repo's bundled slack manifest. Deterministic repro: add vi.resetModules() to the file. This is the plugin-manifest/module-leak class tracked separately (nested-worktree plugin-manifest leak follow-up).

User Impact

Maintainers can run pnpm test / scripts/pr prepare-run on macOS and get a green gate. No production code changes; test-only (+ test helpers).

Evidence

Host: Darwin 25.5, Node 24, system TZ Europe/London.

  • Issue repro before fix: node scripts/run-vitest.mjs run --config test/vitest/vitest.infra.config.ts src/infra/exec-approvals-analysis.test.ts src/infra/backup-create.test.ts → 3 failed. After: 59/59 pass.
  • All 44 test files consuming the canonicalized state helper: pass (13 shards).
  • Each fixed suite verified solo green after its fix (boundary-artifacts 16/16 while the full suite was loading the machine; install-policy + secrets; logs-cli 37/37; qqbot both files; reload-handlers/codex/imessage/cli batch: 5 shards).
  • Full pnpm test-equivalent (node scripts/test-projects.mjs) on this Mac, five runs: baseline failed 13/89 shards; the failing-test inventory across runs surfaced 21 distinct cases (each run samples a different subset); intermediate runs converged to 1 failed shard as fixes landed (the qqbot pair was proven pre-existing by reverse-applying the helper edits against pristine helpers, and the tooling pid-file pair surfaced only in run 4); final run on the committed tree: 89/89 shards passed, exit 0.
  • Typecheck: node scripts/run-tsgo.mjs -b tsconfig.projects.json exit 0.
  • Codex autoreview (gpt-5.5): clean, no accepted/actionable findings.

@steipete
steipete requested a review from a team as a code owner July 4, 2026 19:30
@openclaw-barnacle openclaw-barnacle Bot added channel: imessage Channel integration: imessage gateway Gateway runtime cli CLI command changes channel: qqbot extensions: codex size: M maintainer Maintainer-authored PR labels Jul 4, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8c0d640d01

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +389 to +390
delete process.env.OPENCLAW_GATEWAY_TOKEN;
delete process.env.OPENCLAW_GATEWAY_PASSWORD;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore auth env after clearing it

When this file runs in shared non-isolated Vitest workers with OPENCLAW_GATEWAY_TOKEN or OPENCLAW_GATEWAY_PASSWORD set by the invoking environment, these deletions are never restored because serviceEnvSnapshot only captures the service marker/PID keys. That permanently changes the worker environment for every later test file, so tests that intentionally read the initial gateway auth env will see a different value. Please include these keys in the suite snapshot or clear them through a scoped env helper.

Useful? React with 👍 / 👎.


expect(result.ok).toBe(true);
expect(result.command).toMatch(/^& .+python3(?:\.\d+)? a\.py$/);
expect(result.command).toBe(`& ${python3} a.py`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Escape fixture Python path in assertion

On Windows hosts whose temp directory contains spaces, such as a profile under C:\Users\Jane Doe, buildEnforcedShellCommand correctly quotes the resolved executable via windowsEscapeArg, producing & "...\python3.exe" a.py. This exact unescaped template then fails even though the renderer is behaving correctly, leaving the Windows/macOS-local test gate red in that environment. Compare against the escaped executable path instead of interpolating python3 raw.

Useful? React with 👍 / 👎.

@clawsweeper

clawsweeper Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed July 4, 2026, 4:59 PM ET / 20:59 UTC.

Summary
The PR canonicalizes shared test fixture roots, relaxes timing-sensitive process tests, and clears shared-worker leaks so local macOS pnpm test/scripts/pr prepare-run can pass.

PR surface: Source +19, Tests +113. Total +132 across 17 files.

Reproducibility: yes. source-reproducible: the linked issue gives the macOS failing command, and the remaining PR defects follow from the current escaping and env-restore contracts without running write-producing tests in this read-only review.

Review metrics: 1 noteworthy metric.

  • Unscoped Env Clears: 2 suites, 4 env keys. Two changed shared-worker suites clear inherited env keys without restoring the original process state, which can keep local automation flaky after merge.

Stored data model
Persistent data-model change detected: serialized state: test/scripts/dev-tooling-safety.test.ts, serialized state: test/scripts/prepare-extension-package-boundary-artifacts.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #100025
Summary: The open issue is the canonical macOS local test-gate report, and this PR is the broader candidate fix while a narrower conflicting PR partially overlaps.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🦞 diamond lobster
Patch quality: 🦐 gold shrimp
Result: needs maintainer review before merge.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Escape the fixture executable path in the Windows-render assertion.
  • Capture and restore gateway auth env keys in run-main.exit.test.ts before clearing them.
  • Capture and restore gateway skip env keys in server-reload-handlers.test.ts before clearing them.

Risk before merge

  • [P1] Windows hosts whose temp or profile path contains spaces can still fail the exec-approvals assertion even when buildEnforcedShellCommand escapes correctly.
  • [P1] run-main.exit.test.ts can delete inherited gateway auth env for the rest of a shared Vitest worker, making later auth-sensitive tests observe a different environment.
  • [P1] server-reload-handlers.test.ts can delete inherited gateway skip env for later gateway-server files in the same isolate: false worker.

Maintainer options:

  1. Fix Test Isolation Before Merge (recommended)
    Update the Windows assertion to use the escaped fixture executable path and snapshot/restore both gateway auth and gateway skip env keys around the suites that clear them.
  2. Wait For Contributor Repair
    Leave the PR open for the contributor to address the same three focused blockers if maintainers do not want automation to touch this branch.
  3. Pause Until Canonical Issue Path Is Chosen
    If maintainers prefer the narrower conflicting PR or a fresh replacement, keep the canonical issue open and close only after a viable fix is selected.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Update `src/infra/exec-approvals-analysis.test.ts` to compare against the `windowsEscapeArg(python3).escaped` rendering, update `src/cli/run-main.exit.test.ts` so `OPENCLAW_GATEWAY_TOKEN` and `OPENCLAW_GATEWAY_PASSWORD` are captured/restored before its `beforeEach` clears them, and update `src/gateway/server-reload-handlers.test.ts` so `OPENCLAW_SKIP_CHANNELS` and `OPENCLAW_SKIP_PROVIDERS` are captured/restored around the file-level clearing; keep the PR test-only and run focused Vitest coverage for those files.

Next step before merge

  • [P2] A focused repair can address the three test-only blockers; the protected maintainer label still means maintainers own final landing.

Security
Cleared: The diff is test/helper-only and does not change dependencies, workflows, package metadata, production secret handling, or runtime security boundaries.

Review findings

  • [P2] Escape the fixture Python path in the assertion — src/infra/exec-approvals-analysis.test.ts:210
  • [P2] Restore auth env after clearing it — src/cli/run-main.exit.test.ts:389-390
  • [P2] Restore skip env after clearing worker leaks — src/gateway/server-reload-handlers.test.ts:223-224
Review details

Best possible solution:

Keep the fixture-level macOS test-gate approach, but restore or scope every newly cleared inherited env key and compare the Windows assertion against the escaped fixture path before merge.

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

Yes, source-reproducible: the linked issue gives the macOS failing command, and the remaining PR defects follow from the current escaping and env-restore contracts without running write-producing tests in this read-only review.

Is this the best way to solve the issue?

No, not yet: the fixture-layer direction is the right boundary, but this PR still needs three narrow test-isolation repairs before it is the best mergeable fix.

Full review comments:

  • [P2] Escape the fixture Python path in the assertion — src/infra/exec-approvals-analysis.test.ts:210
    buildEnforcedShellCommand renders resolved Windows argv tokens through windowsEscapeArg, so a fixture path under a profile or temp dir with spaces is correctly quoted. This exact expected string still interpolates the raw path and will fail in that environment even though the renderer is behaving correctly; compare against the escaped executable path instead.
    Confidence: 0.9
  • [P2] Restore auth env after clearing it — src/cli/run-main.exit.test.ts:389-390
    This file now deletes OPENCLAW_GATEWAY_TOKEN and OPENCLAW_GATEWAY_PASSWORD in every beforeEach, but serviceEnvSnapshot still restores only the service marker/PID keys. In shared non-isolated workers launched with gateway auth env set, later files will observe those auth values as removed; include these keys in the snapshot or clear them through a scoped env helper.
    Confidence: 0.88
  • [P2] Restore skip env after clearing worker leaks — src/gateway/server-reload-handlers.test.ts:223-224
    Late discovery: this code was already visible at the earlier reviewed head. The gateway-server shard runs with isolate: false, so deleting OPENCLAW_SKIP_CHANNELS and OPENCLAW_SKIP_PROVIDERS here without restoring inherited values changes the worker environment for later files; snapshot and restore these keys around the file-level cleanup.
    Confidence: 0.82
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: The PR targets a maintainer-local test gate failure with limited runtime blast radius, but current blockers can still keep test automation red.
  • merge-risk: 🚨 automation: Merging the current diff can leave Windows or shared-worker local test lanes failing despite green unrelated CI checks.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (live_output): The PR body includes after-fix macOS live output for the focused repro, a full node scripts/test-projects.mjs 89/89 pass, typecheck success, and clean autoreview notes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix macOS live output for the focused repro, a full node scripts/test-projects.mjs 89/89 pass, typecheck success, and clean autoreview notes.
Evidence reviewed

PR surface:

Source +19, Tests +113. Total +132 across 17 files.

View PR surface stats
Area Files Added Removed Net
Source 4 23 4 +19
Tests 13 165 52 +113
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 17 188 56 +132

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs run --config test/vitest/vitest.infra.config.ts src/infra/exec-approvals-analysis.test.ts src/cli/run-main.exit.test.ts src/cli/gateway-cli/run.option-collisions.test.ts.
  • [P1] node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway-server.config.ts src/gateway/server-reload-handlers.test.ts.

What I checked:

  • Repository policy applied: Root AGENTS.md and scoped guides for extensions/, src/gateway/, and test/ were read; the review applied the explicit policies for macOS realpath test roots, isolate: false cleanup, gateway test state, and direct Codex source checks. (AGENTS.md:1, ed098c655069)
  • Live PR state: Live GitHub data shows this PR is open at head a5fbfd85af50b7877710e936598fa30306b82577, carries the protected maintainer label and proof: sufficient, and targets the open macOS local test-gate issue. (a5fbfd85af50)
  • Canonical issue remains open: The linked issue remains open and contains the concrete macOS repro command for the local test gate failure this PR is intended to fix.
  • Unescaped PR-head assertion: At PR head, the Windows enforced-command test compares against the raw fixture executable path, so Windows temp/profile paths with spaces fail even though the renderer quotes correctly. (src/infra/exec-approvals-analysis.test.ts:210, a5fbfd85af50)
  • Windows escaping contract: Current main renders every Windows argv token through windowsEscapeArg, which quotes tokens containing spaces or other non-simple characters before returning the enforced PowerShell call. (src/infra/windows-shell-command.ts:195, ed098c655069)
  • Auth env clear without matching snapshot: At PR head, run-main.exit.test.ts clears OPENCLAW_GATEWAY_TOKEN and OPENCLAW_GATEWAY_PASSWORD in beforeEach, but serviceEnvSnapshot captures only the service marker and PID keys. (src/cli/run-main.exit.test.ts:123, a5fbfd85af50)

Likely related people:

  • steipete: Recent merged test/gateway maintenance and the current PR history tie Peter Steinberger to the local test-gate, exec-approval, gateway, and shared test-helper surfaces. (role: recent area contributor; confidence: high; commits: 280e8d487627, ed098c655069, 68d31c53965b; files: src/infra/exec-approvals-analysis.test.ts, src/cli/run-main.exit.test.ts, src/cli/gateway-cli/run.option-collisions.test.ts)
  • Vincent Koc: Current-main blame points the baseline exec-approval, CLI exit, gateway reload, and Codex watcher test surfaces at commit cf36cb915dd64898fad2a80eeaa4369908db93dd. (role: baseline test surface introducer; confidence: medium; commits: cf36cb915dd6; files: src/infra/exec-approvals-analysis.test.ts, src/cli/run-main.exit.test.ts, src/gateway/server-reload-handlers.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (2 earlier review cycles)
  • reviewed 2026-07-04T19:42:05.044Z sha 8c0d640 :: needs changes before merge. :: [P2] Restore gateway auth env after clearing it | [P2] Escape the fixture Python path in the assertion
  • reviewed 2026-07-04T20:53:11.165Z sha a5fbfd8 :: needs changes before merge. :: [P2] Restore auth env after clearing it | [P2] Escape the fixture Python path in the assertion

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Jul 4, 2026
steipete added 4 commits July 4, 2026 21:44
Canonicalize shared fixture roots (fs.realpath after mkdtemp) so tests that
intercept or compare fs paths by equality survive the macOS /var ->
/private/var tmpdir symlink; resolve exec-approvals python3 from a fixture
PATH instead of the host; pin UTC for the logs-cli rendered-timestamp
assertion; canonicalize qqbot scoped-media fixtures.

Fixes the deterministic macOS failures in #100025 plus the
store.pruning.integration and qqbot classes.
Forking no-output scripts emit a readiness byte after the pid write so the
rolling no-output window starts once the pid exists; boundary-artifacts
waitForFile now requires non-empty content (empty read parsed to a NaN pid)
and sibling failures are sentinel-gated instead of timer-raced; crabbox
DELETE_CWD_ONCE restore deadline becomes a real fail-safe; codex turn-watch
delay asserted within a bounded window and the promptness test no longer
races startup against a 200ms attempt cap.
server-reload-handlers clears leaked OPENCLAW_SKIP_CHANNELS/PROVIDERS before
each test (module-load side effect of sibling gateway helpers); gateway run
--token exports credentials into process.env, so option-collisions snapshots
and clears them and run-main.exit clears them per test; the imessage
watch-subscribe-retry test clears the leaked runtime singleton so a sibling
file's recovery cursor cannot add since_rowid.
waitFor existsSync + immediate parseInt raced writeFileSync and produced NaN
pids under parallel-suite load; both suites now share a waitForPidFile helper
that polls for non-empty content, with headroom for tsx-booting probes.
@steipete
steipete force-pushed the claude/clever-taussig-71cd25 branch from 8c0d640 to a5fbfd8 Compare July 4, 2026 20:48

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a5fbfd85af

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +223 to +224
delete process.env.OPENCLAW_SKIP_CHANNELS;
delete process.env.OPENCLAW_SKIP_PROVIDERS;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore skip env after clearing worker leaks

When the gateway-server shard runs with OPENCLAW_SKIP_CHANNELS or OPENCLAW_SKIP_PROVIDERS set by the invoking environment, this new beforeEach deletes those values and never restores them. That shard runs with isolate: false in test/vitest/vitest.gateway-server.config.ts, so later files in the same worker see a different env; it also defeats the per-test snapshots below because they now snapshot undefined. Please snapshot these two keys before clearing and restore them after the suite.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 4, 2026
@steipete
steipete merged commit bbb7442 into main Jul 4, 2026
163 of 168 checks passed
@steipete
steipete deleted the claude/clever-taussig-71cd25 branch July 4, 2026 21:17
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 5, 2026
…0069)

Fixes 21 macOS-only failing test cases across three classes: canonicalized fixture roots (macOS /var -> /private/var tmpdir symlink vs production realpathing), load-tolerant process-spawn tests (content-gated pid files, readiness-sequenced kill windows, bounded-window timer assertions), and cross-file worker leak guards (skip-channel env, gateway token env, imessage runtime singleton). Test-only; no production changes. Fixes openclaw#100025.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: imessage Channel integration: imessage cli CLI command changes extensions: codex gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Infra tests fail on macOS main: quoted host python breaks Windows-render regex; late-SQLite guard test misses realpathed state dir

1 participant