[PR #2414] Use Bun.which to locate opencode command #10301

Closed
opened 2026-02-16 18:14:55 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/2414

State: closed
Merged: No


This pull request makes a targeted improvement to the createOpencodeServer function by ensuring that the opencode executable is located using Bun's which utility, rather than relying on the system path. This change increases reliability when spawning the server process.

  • Improved process spawning:
    • Updated the spawn call in server.ts to use Bun.which('opencode') for locating the opencode executable, ensuring the correct binary is used.

Reasoning

Currently i have never been able to successfully use createOpencodeServer without forking the file over and performing some modification. Bun.which should solve this by giving an absolute path to the opencode binary

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/2414 **State:** closed **Merged:** No --- This pull request makes a targeted improvement to the `createOpencodeServer` function by ensuring that the `opencode` executable is located using Bun's `which` utility, rather than relying on the system path. This change increases reliability when spawning the server process. - Improved process spawning: * Updated the `spawn` call in `server.ts` to use `Bun.which('opencode')` for locating the `opencode` executable, ensuring the correct binary is used. ## Reasoning Currently i have never been able to successfully use createOpencodeServer without forking the file over and performing some modification. Bun.which should solve this by giving an absolute path to the opencode binary
yindo added the pull-request label 2026-02-16 18:14:55 -05:00
yindo closed this issue 2026-02-16 18:14:55 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#10301