[PR #7150] fix(tui): restore attach session lookup behavior #12272

Closed
opened 2026-02-16 18:17:11 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/7150

State: closed
Merged: Yes


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

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/7150 **State:** closed **Merged:** Yes --- ## 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
yindo added the pull-request label 2026-02-16 18:17:11 -05:00
yindo closed this issue 2026-02-16 18:17:11 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12272