Repository navigation
v0.5.1 — Fix workspace directory switching
Bug Fix
- Fix:
npx squid-chatfrom a NEW project directory while an old instance is still running now correctly starts in the new directory instead of reopening the old instance.
Behavior
When you run npx squid-chat in a directory that differs from the currently running instance:
- The old instance is gracefully stopped (SIGTERM)
- The code waits for the OpenCode server port to be released
- A fresh instance starts in your current directory
Previously it just re-opened the old URL and returned, ignoring the new project entirely.
Implementation
- Uses the
cwdfield saved in runtime state to detect directory mismatch - Sends SIGTERM to old process on mismatch
- New
waitForPortFree()helper polls TCP port availability with 8s timeout
Full Changelog: v0.5.0...v0.5.1