opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Fix/nested cwd server handling

Open shuv1337 opened this issue 2 weeks ago • 0 comments

Fixed server failures when starting from deeply nested directories by changing process.cwd() to home directory at startup.

Added process.chdir(Global.Path.home) in serve and web command handlers to establish stable working directory Updated server middleware fallback from process.cwd() to Global.Path.home for consistency Added comprehensive regression tests validating the fix across multiple scenarios The fix prevents "No such file or directory" errors that occurred when the server process's working directory became invalid or was deleted

Before:

https://github.com/user-attachments/assets/683f848a-ff62-4c5f-b3ca-2b1973f1d752

After:

https://github.com/user-attachments/assets/d9e77d2e-b0d9-4a4c-8271-9dac90f64e67

shuv1337 avatar Jan 01 '26 05:01 shuv1337