Skip to content

Regression: /sessions command no longer filters by current working directory #19340

@jimicze

Description

@jimicze

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions