Skip to content

fix: preflight the OpenCode PowerShell launcher - #3907

Merged
CompleteDotTech merged 24 commits into
mainfrom
fix/opencode-preflight-3862
Jul 26, 2026
Merged

fix: preflight the OpenCode PowerShell launcher#3907
CompleteDotTech merged 24 commits into
mainfrom
fix/opencode-preflight-3862

Conversation

@CompleteDotTech

@CompleteDotTech CompleteDotTech commented Jul 26, 2026

Copy link
Copy Markdown
Member

Summary

Preflight the exact OpenCode launch plan and show unavailable runtimes truthfully in chat and setup UI.

Closes #3862.

Current implementation

  • Uses the same familiar-scoped environment for Windows PowerShell host resolution, PATHEXT OpenCode lookup, capability probes, and the JSON-over-stdin spawn.
  • Distinguishes missing OpenCode (runtime_missing) from a preflight-detected broken PowerShell host (runtime_unlaunchable); ambiguous Windows post-preflight ENOENT races remain value-free runtime_launch_failed.
  • Prevents capability probes/spawns on unavailable plans; launch failures produce no auth/no-output diagnosis or fabricated assistant turn.
  • Surfaces availability/remediation in Familiar Studio, Summoning Circle, and chat setup recovery without local path leakage.

Rebase and validation

Rebased onto current origin/main 14780987 and force-pushed head d4aba87d. The existing b0fe39cc follow-up fixes the branch-caused Frontend build failure: api-contracts.test.ts now pins the structured post-spawn race code instead of the obsolete ENOENT wire code, including the longer OpenCode classification branch.

Passed after this rebase: opencode-bin, runtime-availability, chat-send-capabilities, harness-routing-opencode, api-contracts, harnesses route, Chat View, Familiar Studio, Summoning Circle, and route-runtime-availability.integration; pnpm lint; pnpm codemod:design:check; pnpm exec tsc --noEmit --pretty false; and git diff --check.

Native Windows note: route-opencode.integration.test.ts cannot isolate its temporary shim on this workstation because the user-global opencode.cmd is rediscovered through the environment's Path entry; it therefore follows that global client rather than the fixture. The isolated CI environment covers the intended OpenCode and missing-runtime paths.

@CompleteDotTech CompleteDotTech self-assigned this Jul 26, 2026
@CompleteDotTech
CompleteDotTech force-pushed the fix/opencode-preflight-3862 branch 4 times, most recently from f09380d to eac7c0b Compare July 26, 2026 19:33
@CompleteDotTech
CompleteDotTech force-pushed the fix/opencode-preflight-3862 branch from eac7c0b to af95b0b Compare July 26, 2026 19:34
@CompleteDotTech
CompleteDotTech force-pushed the fix/opencode-preflight-3862 branch from b0fe39c to 88861eb Compare July 26, 2026 20:20
@CompleteDotTech
CompleteDotTech marked this pull request as ready for review July 26, 2026 22:47
@CompleteDotTech
CompleteDotTech merged commit 4d40bc5 into main Jul 26, 2026
15 checks passed
@CompleteDotTech
CompleteDotTech deleted the fix/opencode-preflight-3862 branch July 26, 2026 22:48
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.

OpenCode: preflight the PowerShell-backed launcher and classify missing command precisely

1 participant