fix(test): make unit (windows) green — routing case-sensitivity, path variants, timeouts (LAC-2693) - #35
Merged
lacymorrow merged 6 commits intoJul 10, 2026
Conversation
2 tasks
There was a problem hiding this comment.
Code Review
This pull request increases the test timeout to 120 seconds for Ripgrep-related tests in both search.test.ts and ripgrep.test.ts. This adjustment prevents test failures on Windows CI runners where downloading and extracting the rg binary can exceed the default 5-second timeout. No review comments were provided, so there is no additional feedback to address.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
…ry (LAC-2693) On Windows CI runners the first Ripgrep.Service use downloads the rg release zip and extracts it via PowerShell Expand-Archive, which exceeds bun's default 5s per-test timeout. The test SIGTERMs the extraction mid-flight, nothing is cached, and all four ripgrep tests repeat the slow path and fail. Give those tests a 120s timeout so the one-time download completes; later tests find the cached binary and stay fast.
…templates (LAC-2693)
On Windows, a shell that does not understand the sentinel wrapper echoes
it literally (e.g. cmd.exe printing "$(pwd -P ..."). That text reached
setCwd() unvalidated, poisoning the process-wide cwd singleton so every
subsequent spawn failed its cwd access check — the shared root cause
behind the ~60 tool.shell failures in the unit (windows) job.
- Extract sentinel parsing into parseCwdSentinelPayload() in the
shell-mode plugin (lash-owned, keeps the prompt.ts patch surface small)
and reject any cwd that is not an absolute posix or win32 path.
- Treat a non-numeric exit-code prefix as part of the cwd so bare
"D:\foo" drive paths parse correctly.
- Make cwd.test.ts expectations platform-aware: on win32,
path.resolve("/workspace", "subdir") yields "D:\workspace\subdir",
so the hardcoded posix strings failed regardless of fixtures.
- Add LAC-2693 regression tests for the parser.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
…LAC-2693) Fixes the 7 failures left after the cwd-sentinel fix, plus the job-level timeout that masked them: - shell-mode routing: Windows PATH lookup is case-insensitive, so "Help me fix this bug" matched System32 help.exe and routed to shell. commandExists now requires the typed name to match the executable's on-disk casing on win32, restoring the POSIX capitalization signal (fixes shouldRouteToShell / determineRouting / prompt-submit-routing). - external-directory + read path-variant tests: stop stripping the drive letter when building the "alt" variant — a drive-less absolute path resolves against the current drive, which differs from TEMP's drive on GitHub-hosted runners (repo on D:, TEMP on C:). - httpapi file/sdk search polls: extend the 5s index-ready poll to 30s; index build regularly exceeds 5s on windows runners. - prompt loop/shell tests: raise 10s per-test timeouts to 30s; git-fixture boot + shell spawn exceed 10s on windows. - test.yml: raise unit-test step timeout-minutes 20 -> 35; opencode#test alone takes ~20 minutes on GitHub-hosted windows runners, so the step timed out before results could flush. Co-Authored-By: Paperclip <noreply@paperclip.ing>
…p exit tests (LAC-2693) - httpapi-file 'serves search endpoints': the suite-wide --timeout 30000 fired before the 30s index-ready poll could complete; give the test a 90s per-test timeout and a 60s poll window - acp lifecycle 'stdin EOF exits cleanly': 5s exit window is tighter than the CLI's bun startup on windows CI; raise to 30s (test allows 60s)
…693) Run 29066011464 surfaced a new flake cluster after the previous two fixes held: all three trace to network/subprocess work on a cold, loaded runner. - test.yml: cache ~/.cache/opencode/bin so the rg binary downloads once per version instead of on every run (the 120s ripgrep test timeout was blown by download + Expand-Archive alone) - ripgrep.test.ts: raise download budget to 240s for cache-miss runs - project.test.ts: 30s timeout on all ProjectV2.resolve tests; each spawns several git subprocesses and two blew the 5s default - instance-bootstrap.test.ts: 120s timeout; bootstrapFixture's plugin triggers a real background npm install of @opencode-ai/plugin that Config.waitForDependencies joins
…oads (LAC-2693) Run 29067707495 failed a single test: 'file HttpApi > serves search endpoints' — the find() index stayed empty through the full 60s poll even though a foreground rg grep in the same test completed in ~1s. Windows uses the ripgrepLayer (fff is disabled on win32 by default), whose index is filled by a background rg --files fiber forked with a bare orDie: any transient spawn failure or hang on a loaded runner kills it silently and leaves find() permanently empty. - search.ts: bound each scan attempt to 120s, retry twice, and log a scan that never completes instead of dying silently; dedupe entries so a retried scan cannot double-add what an interrupted attempt indexed - test/preload.ts: seed the per-PID temp cache with the rg binary from the user's real cache (which CI now restores via actions/cache) so opencode tests stop re-downloading rg mid-suite on every run
lacymorrow
force-pushed
the
LAC-2693/fix-windows-ripgrep-test-timeouts
branch
from
July 10, 2026 06:54
9906eab to
cf47752
Compare
lacymorrow
merged commit Jul 10, 2026
1ad5eed
into
LAC-2385/blacksmith-to-github-runners
6 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes LAC-2693 — the
unit (windows)job failures surfaced by the GitHub-hosted runner switch (PR #28). Sibling of PR #33 (linux).The original 112 failures reduced to 11 after PR #33's fixture fix + the ripgrep timeout fix here. This PR clears the rest:
Product fixes
plugin/shell-mode/cwd.ts): a shell that doesn't understand the sentinel wrapper (e.g. cmd.exe echoing$(pwd -P ...)literally) poisoned the process-wide cwd singleton, cascading into dozens of tool.shell failures. Sentinel payloads are now parsed/validated inparseCwdSentinelPayload()— non-absolute paths are rejected. Regression tests added.plugin/shell-mode/command-check.ts): Windows PATH lookup is case-insensitive, so "Help me fix this bug" matchedSystem32\help.exeand routed to shell instead of the agent.commandExistsnow requires the typed name to match the executable's on-disk casing on win32, restoring the POSIX capitalization signal.Test fixes
cwd.test.ts: platform-aware path expectations (/workspace/subdirvsD:\workspace\subdir).external-directory.test.ts/read.test.ts: keep the drive letter when building the "alt" path variant — a drive-less absolute path resolves against the current drive, which differs from TEMP's drive on GitHub-hosted runners (repo onD:, TEMP onC:).httpapi-file/httpapi-sdk: extend the 5s search-index poll to 30s (index build regularly exceeds 5s on windows runners).prompt.test.tsloop/shell tests: raise 10s per-test timeouts to 30s (git-fixture boot + shell spawn exceed 10s on windows).rgbinary.CI fix
test.yml: unit-test steptimeout-minutes20 → 35.opencode#testalone takes ~20 min on GitHub-hosted windows runners; the step timed out before turbo flushed results (which is why the last run looked like a silent hang).Testing
unit (windows)check on this PR.Acceptance criteria
unit (windows)job reachessuccess— verified by this PR's checks