Skip to content

ci(windows): DISABLE_FILEWATCHER env (match upstream)#8

Merged
Astro-Han merged 2 commits into
devfrom
worktree-fix-windows-ci-retry
Apr 17, 2026
Merged

ci(windows): DISABLE_FILEWATCHER env (match upstream)#8
Astro-Han merged 2 commits into
devfrom
worktree-fix-windows-ci-retry

Conversation

@Astro-Han

@Astro-Han Astro-Han commented Apr 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replaces the retry wrapper approach with OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER: true on Windows only (matches upstream OpenCode's test.yml).
  • Ubuntu unchanged.
  • Reverts job timeout-minutes 45 → 30 (not needed without retry).
  • Drops the inline comment documenting the narrower "16ms edge case" diagnosis.

Why

The retry approach (first version of this PR) was validated with 5 reruns on the same SHA: 4/4 completed reruns FAILED. Both inner retry attempts fail each time, on DIFFERENT tests from a ~10-test pool (config-deps 30s timeouts, shell/loop 3s, skill discovery, node server bootstrap, multiple file ops). The flake surface is far broader than the initial "16ms shell/loop" hypothesis.

Upstream OpenCode hit the same problem and uses OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER=true on Windows. The flag already exists in our code (packages/opencode/src/flag/flag.ts:57, 13 call sites); the fork just never wired it in CI.

Related cleanup recorded in docs/TODO.md:

  • Merge publish.yml (dead in fork, gated to anomalyco/opencode) + build.yml (only active for macOS arm64) into a single release workflow. Out of scope for this PR.

Test plan

  • CI on this PR: Ubuntu + Windows both green
  • Trigger 4 more reruns on this commit via gh run rerun; collect 5 data points
  • Failure rate < 20% on Windows acceptable; if higher, escalate to tier-2 (OS-scaled timeouts / bun test --jobs / split unit vs e2e)

GitHub Windows runners occasionally cross the 3000ms timeout on
timing-sensitive shell/loop tests by ~16ms. Wrap the Windows test
step in nick-fields/retry@v3 with max_attempts=2 so transient jitter
does not red CI. Ubuntu unaffected. Stable failures still fail on
retry, so real bugs are not masked.

Also bump job timeout from 30min to 45min to fit worst-case 2x test
run on Windows.
Validation of the retry approach (5-run loop, 4 completed reruns)
showed 0/4 pass — the flake surface is broader than the 16ms
shell/loop edge case we diagnosed. Failures sampled randomly from
a ~10-test pool (config-deps 30s timeouts, shell 3s, skill
discovery, node server bootstrap, multiple file ops), different
tests each run.

Upstream OpenCode's own test.yml sets
OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER=true on Windows for the
same reason. The flag already exists in our code
(packages/opencode/src/flag/flag.ts:57, 13 refs); we just never
wired it in CI. Match upstream's pattern.

Also revert timeout-minutes 45 -> 30 (no longer needed without
retry) and drop the misleading "16ms edge case" comment.
@Astro-Han Astro-Han changed the title ci(windows): retry test step once to absorb runner jitter ci(windows): DISABLE_FILEWATCHER env (match upstream) Apr 17, 2026
@Astro-Han Astro-Han merged commit 370b303 into dev Apr 17, 2026
4 of 10 checks passed
@Astro-Han Astro-Han deleted the worktree-fix-windows-ci-retry branch April 17, 2026 12:33
Astro-Han added a commit that referenced this pull request Apr 27, 2026
PawWork users on their own provider keys should not silently inherit
global Claude Code instructions as their PawWork baseline (issue #230,
acceptance #5). Gates the fallback push behind a Runtime.isPawWork()
check so the existing opt-out flag still works for plain opencode CLI
users; project-level CLAUDE.md remains as compatibility (#6).

The lookup also routes through Global.Path.home so OPENCODE_TEST_HOME
can stub the home directory deterministically — Bun's os.homedir() is
locked at process start, which would otherwise make the global Claude
path untestable under Bun's test runner.

Tests cover the five scenarios from acceptance #8: fresh install, project
AGENTS.md, project CLAUDE.md compatibility fallback, PawWork global
AGENTS.md, and the now-ignored ~/.claude/CLAUDE.md. A non-PawWork
regression test guards the Runtime.isPawWork() gate so an accidental
condition inversion would fail the suite.
Astro-Han added a commit that referenced this pull request Apr 27, 2026
PawWork users on their own provider keys should not silently inherit
global Claude Code instructions as their PawWork baseline (issue #230,
acceptance #5). Gates the fallback push behind a Runtime.isPawWork()
check so the existing opt-out flag still works for plain opencode CLI
users; project-level CLAUDE.md remains as compatibility (#6).

The lookup also routes through Global.Path.home so OPENCODE_TEST_HOME
can stub the home directory deterministically — Bun's os.homedir() is
locked at process start, which would otherwise make the global Claude
path untestable under Bun's test runner.

Tests cover the five scenarios from acceptance #8: fresh install, project
AGENTS.md, project CLAUDE.md compatibility fallback, PawWork global
AGENTS.md, and the now-ignored ~/.claude/CLAUDE.md. A non-PawWork
regression test guards the Runtime.isPawWork() gate so an accidental
condition inversion would fail the suite.
Astro-Han added a commit that referenced this pull request Apr 27, 2026
…k mode

PawWork users on their own provider keys should not silently inherit
global Claude Code instructions as their PawWork baseline (issue #230,
acceptance #5). Gates the global fallback push behind a
Runtime.isPawWork() check so the existing opt-out flag still works for
plain opencode CLI users; project-level CLAUDE.md remains as
compatibility (acceptance #6) and is unaffected here.

The lookup also routes through Global.Path.home so OPENCODE_TEST_HOME
can stub the home directory deterministically — Bun's os.homedir() is
locked at process start, which would otherwise make this code path
untestable under Bun's test runner.

Tests cover the five fallback scenarios from acceptance #8: fresh
install, project AGENTS.md, project CLAUDE.md compatibility fallback,
PawWork global AGENTS.md, and the now-ignored ~/.claude/CLAUDE.md. A
non-PawWork regression test guards the Runtime.isPawWork() gate so an
accidental inversion would fail the suite.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant