Description
Running opencode -s <session-id> should resume the session in that session's stored working directory. Today, local resume can keep using the directory where the command was launched instead.
That makes the resumed session look correct in history, but the active execution context can be wrong:
- prompts report the launch directory rather than the session directory
- relative file paths resolve from the launch directory
- tools and shell commands run against the wrong project
- TUI resume starts the worker with the launch/project directory even when the session was created elsewhere
This is easy to hit when resuming a known session from a different terminal directory, or when continuing sessions across worktrees/subdirectories.
Plugins
None required.
OpenCode version
Current dev.
Steps to reproduce
- Create a session in directory
A.
- From directory
B, run opencode -s <session-id-from-A>.
- Ask opencode for the current working directory or run a relative file/tool operation.
Expected: the resumed session uses directory A, the stored session.directory.
Actual: the resumed session can continue using directory B, the launch directory.
Screenshot and/or share link
No response
Operating System
macOS, but this is CLI/session directory handling and should not be OS-specific.
Terminal
Any terminal.
Description
Running
opencode -s <session-id>should resume the session in that session's stored working directory. Today, local resume can keep using the directory where the command was launched instead.That makes the resumed session look correct in history, but the active execution context can be wrong:
This is easy to hit when resuming a known session from a different terminal directory, or when continuing sessions across worktrees/subdirectories.
Plugins
None required.
OpenCode version
Current
dev.Steps to reproduce
A.B, runopencode -s <session-id-from-A>.Expected: the resumed session uses directory
A, the storedsession.directory.Actual: the resumed session can continue using directory
B, the launch directory.Screenshot and/or share link
No response
Operating System
macOS, but this is CLI/session directory handling and should not be OS-specific.
Terminal
Any terminal.