fix: implement shadow copying for native binaries on Windows#8
fix: implement shadow copying for native binaries on Windows#8mynameistito wants to merge 1 commit intoshekohex:mainfrom
Conversation
|
Edit: sweet it works as intended on Windows! However maybe a little laggy if anyone else on Windows wants to check it out too that would be great :) |
|
You should upgrade to https://github.com/shekohex/opencode-pty/releases/tag/v0.1.5 and try to apply your fix. or maybe it works without it? opencode uses the same lib internally, so maybe worth firing off an agent and it will help with that. Needs more eyes on this PR for people with windows machines to try it out. |
Will have a suss, also FYI that was fired off by my agent 😭 |
Hey so yeah, I haven't fired my agent on it yet, but it still insta crashes with it on. and giving the issue failed to install for a plugin that is set after this plugin. Will try get my agent to fix it later. |
Summary
This PR implements Shadow Copying for the
bun-ptynative binaries on Windows to resolve file-locking conflicts that cause the OpenCode Host to crash during multi-instance startup.Changes
src/plugin/pty/shadow.tsto handle copying therust_pty.dllto a temporary directory and settingprocess.env.BUN_PTY_LIB.PTYManagerinsrc/plugin/pty/manager.tsto lazy-load thebun-ptymodule only when needed, after ensuring the shadow copy is prepared.ptySpawntool insrc/plugin/pty/tools/spawn.tsto support the now-asyncmanager.spawnmethod.Impact
EBUSYerrors when OpenCode attempts to verify plugins (especially those on@latest) while a PTY session is active.