Skip to content

v0.5.1 — Fix workspace directory switching

Choose a tag to compare

@drewsephski drewsephski released this 03 Jun 21:41
· 6 commits to main since this release

Bug Fix

  • Fix: npx squid-chat from 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:

  1. The old instance is gracefully stopped (SIGTERM)
  2. The code waits for the OpenCode server port to be released
  3. 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 cwd field 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