You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
opencode attach --session fails with 'Session not found' since v1.1.1 #7149
opencode attach with --session flag fails with "Session not found" error when the client's current working directory differs from the directory where the session was created.
This is a regression introduced in v1.1.1 by commit 401b498 (PR #6715).
OpenCode version
v1.1.1 and later (worked in v1.0.223)
Steps to reproduce
Start opencode server in directory A (e.g., /Users/me/project-a)
Create a session, note the session ID (e.g., ses_abc123)
The same session works fine when accessed via browser at http://localhost:4096/<base64-encoded-directory>/session/ses_abc123.
Root cause
PR #6715 added directory: process.cwd() to the attach command, which sends the client's current working directory as the x-opencode-directory header. Sessions are stored per-project (keyed by directory), so when the client's cwd differs from the session's directory, the server looks in the wrong project and fails to find the session.
Before v1.1.1, no directory was sent, so the server fell back to its own process.cwd() (where the session was created).
Both issues describe attach failures in v1.1.1 with session-related errors, though #6874 focuses on the parentID crash during attach while #7149 focuses on the session not being found due to directory mismatch. However, they both appear to be v1.1.1 regressions involving the attach command and session handling.
Feel free to ignore if this doesn't address your specific case.
Activity
fix(tui): restore attach session lookup behavior
github-actions commentedon Jan 7, 2026
This issue might be a duplicate of an existing issue. Please check:
Both issues describe attach failures in v1.1.1 with session-related errors, though #6874 focuses on the parentID crash during attach while #7149 focuses on the session not being found due to directory mismatch. However, they both appear to be v1.1.1 regressions involving the attach command and session handling.
Feel free to ignore if this doesn't address your specific case.