Repository navigation
Releases: drewsephski/opencodesdk
Release list
v0.7.1
Full Changelog: v0.7.0...v0.7.1
v0.7.0
Full Changelog: v0.6.4...v0.7.0
Full Changelog: v0.6.4...v0.7.0
v0.6.4
v0.6.0 — Always start fresh, lsof-based orphan cleanup
Major robustness rewrite
The problem
Squid-chat's opencode serve child process was becoming orphaned (PPID=1 reparented to init) when the parent Node.js process died, holding port 4096 with the old project directory locked. Subsequent runs found the port busy and silently reused the orphan — operating in the wrong project and continuing old conversations.
Additionally, the 'same-directory' detection relied on the cwd field in runtime state, which didn't exist in older versions, causing the fallback to always reopen the old instance.
The fix — complete startup redesign
- Always start fresh: Eliminated the 'Using existing OpenCode server' path entirely. Every run starts its own
opencode serve. - lsof-based orphan cleanup: If anything is listening on the OpenCode port,
killProcessOnPort()useslsof -ti :PORTto find the PID(s) and kills them with SIGTERM before waiting for the port to be released. - Safe fast-path: The only reuse is when the exact same squid-chat Node.js process (same PID + same
cwd) is still running — then we just reopen the URL. - New helpers:
checkPortFree()andkillProcessOnPort()extract and improve the port-management logic.
Full Changelog: v0.5.1...v0.6.0
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
v0.5.0 — Robust npx CWD handling
Fixes & Enhancements
- Fix: OpenCode now correctly uses the directory where
npx squid-chatwas run as its working directory (restoredprocess.chdirbefore spawning the OpenCode server — the SDK doesn't supportcwdoption) - Validate: Target directory existence and read permissions checked before starting
- Binary check: Verifies OpenCode binary is executable; auto-redownloads if not
- Cleaner shutdown: Uses
AbortSignalfor the OpenCode server process lifecycle - Port check: Fixed to properly await the test server close callback
- State tracking: Runtime state now records
cwdfor diagnostics - Cleanup: State files are now properly deleted (
unlink) instead of written with empty content
Full Changelog: v0.4.9...v0.5.0
v0.4.9
v0.4.7
v0.4.6
v0.4.5
Full Changelog: v0.4.4...v0.4.5
Full Changelog: v0.4.4...v0.4.5