Skip to content

fix: filter archived sessions from per-project session list#27034

Open
bingkxu wants to merge 1 commit into
anomalyco:devfrom
bingkxu:fix/filter-archived-sessions-v2
Open

fix: filter archived sessions from per-project session list#27034
bingkxu wants to merge 1 commit into
anomalyco:devfrom
bingkxu:fix/filter-archived-sessions-v2

Conversation

@bingkxu
Copy link
Copy Markdown

@bingkxu bingkxu commented May 12, 2026

Issue for this PR

Closes #27030

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The per-project session listing (Session.list() / GET /session) returns all sessions including archived ones, while the global listing (Session.listGlobal() / GET /experimental/session) already filters out archived sessions via isNull(time_archived).

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

Fix: Added isNull(SessionTable.time_archived) filter condition to listByProject() function to match listGlobal() behavior. Also added archived?: boolean option to ListInput type so callers can optionally include archived sessions.

How did you verify your code works?

  • Ran bun typecheck in packages/opencode - no new type errors
  • Manually tested: archived sessions no longer appear in per-project session list output

Screenshots / recordings

N/A (backend change, no UI impact)

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

listByProject() was returning all sessions including archived ones,
while listGlobal() already filtered them. Added isNull(time_archived)
filter to match listGlobal behavior.

Closes anomalyco#27030
@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found one highly relevant PR that addresses a very similar issue:

Potential Duplicate:

This PR (#27034) may be addressing the same bug or a follow-up fix specific to the per-project listing. You may want to check if PR #24907 already covers this functionality or if this is a separate oversight in the per-project listing that was missed in the previous fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: archived sessions pollute per-project session list

1 participant