Skip to content

fix: archived sessions pollute per-project session list #27030

@bingkxu

Description

@bingkxu

Problem

Session.list() (per-project session listing) returns all sessions including archived ones, while Session.listGlobal() already filters them out via isNull(time_archived).

This causes archived sessions from automated workflows (cron tasks, CI runs) to pollute the session history displayed to users.

Solution

Add isNull(SessionTable.time_archived) filter to listByProject() function to match listGlobal() behavior.

Code Change

In packages/opencode/src/session/session.ts:

  • Add archived?: boolean to ListInput type
  • Add filter condition in listByProject()

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