Description
Description
The /sessions command no longer filters sessions by the current working directory/project path. Previously, sessions were scoped to the directory where they were created.
Current Behavior
/sessions shows all sessions regardless of the directory they were created in.
Expected Behavior
/sessions should filter sessions by the current working directory, as it did previously.
Root Cause
In packages/opencode/src/cli/cmd/session.ts:93, Session.list() is called without the directory parameter:
const sessions = [...Session.list({ roots: true, limit: args.maxCount })]
The Session.list() function supports a directory parameter, and sessions store directory in the database, but the CLI/TUI doesn't pass it.
Suggested Fix
const sessions = [...Session.list({ roots: true, limit: args.maxCount, directory: process.cwd() })]
Plugins
No response
OpenCode version
1.2.27
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
macOS 15.2
Terminal
Ghostty
Description
Description
The /sessions command no longer filters sessions by the current working directory/project path. Previously, sessions were scoped to the directory where they were created.
Current Behavior
/sessions shows all sessions regardless of the directory they were created in.
Expected Behavior
/sessions should filter sessions by the current working directory, as it did previously.
Root Cause
In packages/opencode/src/cli/cmd/session.ts:93, Session.list() is called without the directory parameter:
const sessions = [...Session.list({ roots: true, limit: args.maxCount })]
The Session.list() function supports a directory parameter, and sessions store directory in the database, but the CLI/TUI doesn't pass it.
Suggested Fix
const sessions = [...Session.list({ roots: true, limit: args.maxCount, directory: process.cwd() })]
Plugins
No response
OpenCode version
1.2.27
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
macOS 15.2
Terminal
Ghostty