Skip to content

prefer a wsl opencode service when the lab is on - #2112

Merged
thdxr merged 3 commits into
devfrom
wsl-precedence
Nov 21, 2026
Merged

thdxr merged 3 commits into
devfrom
wsl-precedence

Conversation

@thdxr

@thdxr thdxr commented Nov 20, 2026

Copy link
Copy Markdown
Member

with Labs › OpenCode in WSL on, hex only looked in wsl when no windows registration answered. the opencode windows desktop app keeps an empty windows service registered, so while it ran that empty service answered, hid the wsl one, and annotate's sends and modes rewriting used it (see #2110: candidates=0, "No sessions match").

now, with the lab on, a wsl service that answers wins and the windows service is the fallback. when windows already confirmed a service the wsl lookup gets min(the caller's remaining budget, WSL_LOOKUP_CAP 3 s), so a cold wsl can't hold a rewrite or annotate's send. prefer_wsl takes the wsl answer first, and with_wsl only shrinks the budget when the windows search confirmed something. lab off is unchanged: the cache is cleared and the windows result comes back untouched.

tests: a_wsl_service_wins_with_the_lab_on_and_the_windows_one_is_the_fallback covers the new precedence. the windows-only branch wasn't compiled locally (no mingw toolchain on this machine), so the windows check in CI is the proof for it.

Fixes #2110

@thdxr
thdxr merged commit de7b012 into dev Nov 21, 2026
6 checks passed
@thdxr
thdxr deleted the wsl-precedence branch November 21, 2026 00:15
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.

Annotate: a Windows OpenCode registration wins over WSL even with the lab on

1 participant