Skip to content

fix: use user temp dir for Windows CLI startup#16571

Closed
niver2002 wants to merge 1 commit intoanomalyco:devfrom
niver2002:fix/windows-temp-opentui
Closed

fix: use user temp dir for Windows CLI startup#16571
niver2002 wants to merge 1 commit intoanomalyco:devfrom
niver2002:fix/windows-temp-opentui

Conversation

@niver2002
Copy link

@niver2002 niver2002 commented Mar 8, 2026

Summary

  • set TMP and TEMP to %LOCALAPPDATA%\Temp before spawning the Windows binary from packages/opencode/bin/opencode
  • avoid OpenTUI DLL load failures on Windows where Bun falls back to bad temp extraction paths like B:/~BUN/root/...
  • keep the fix scoped to the Windows launcher so generated npm wrappers do not need custom patching

Verification

  • reproduced the local Windows failure with Failed to initialize OpenTUI render library ... error code 126
  • verified that forcing a user-scoped temp directory lets the TUI boot normally
  • upstreamed the same fix into the launcher source used by the published package

@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2026

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Mar 8, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2026

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@niver2002
Copy link
Author

Reproduced locally on Windows with . Confirmed that forcing to lets the TUI boot normally, so this PR upstreams the same launcher-side fix.

@niver2002
Copy link
Author

Summary: on Windows, set TMP and TEMP to the user's LOCALAPPDATA Temp directory before spawning the packaged binary from packages/opencode/bin/opencode. This avoids OpenTUI DLL load failures where Bun falls back to invalid temp extraction paths and the CLI hangs at startup with error code 126. Verification: I reproduced the failure locally, confirmed that switching to a user-scoped temp directory lets the TUI boot normally, and upstreamed that same launcher-side fix here.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2026

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Mar 8, 2026
@github-actions github-actions bot closed this Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant