opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix(tui): restore attach session lookup behavior

Open rmk40 opened this issue 1 week ago • 1 comments

Summary

Fixes regression where opencode attach --session fails with "Session not found" when run from a different directory than where the session was created.

The issue

PR #6715 (commit 401b498c7) introduced a regression by always sending process.cwd() as the directory context. Sessions are stored per-project, so when the client's cwd differs from the session's directory, lookup fails.

The fix

Only send the directory header when --dir is explicitly provided. Otherwise, let the server fall back to its own working directory (the pre-v1.1.1 behavior).

Fixes #7149

rmk40 avatar Jan 07 '26 01:01 rmk40