Skip to content

Leave archived threads out of bb thread list by default - #6886

Merged
ymichael merged 1 commit into
mainfrom
bb/exclude-archived-threads-from-bb-thread-list-by-thr_sipei3j4m9
Nov 3, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/exclude-archived-threads-from-bb-thread-list-by-thr_sipei3j4m9

Conversation

@ymichael

@ymichael ymichael commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

bb thread list sent no archived filter, so the route (which defaults to all threads for SDK callers such as storage-retention) returned archived threads too, while bb thread count excludes them. In this repo's project the two disagreed: 41 counted, 4,113 listed.

What changed

  • apps/cli/src/commands/thread/list.ts: sends archived=false unless --archived, the new --include-archived, or explicit --thread IDs are given. --thread lookups keep returning archived threads, as the flag's help promises. --archived with --include-archived is rejected. The route default is unchanged.
  • packages/db/src/data/threads.ts: deletes buildListThreadsForProjectsFilters, an exact duplicate of part of buildListThreadsFilters; the projects listing now uses the main builder plus its project filter.
  • bb-guide-thread-inspection.md: documents --include-archived and the default.

No SDK or host-daemon protocol changes.

How you verified

  • New CLI command-output tests for the archived query (default, --archived, --include-archived, --thread + --archived) and the flag conflict; 10 of 16 thread-list tests fail with the old list.ts.
  • pnpm exec turbo run test typecheck --filter=@bb/cli --filter=@bb/db --filter=@bb/templates passes; server project/startup/skeleton route tests pass.
  • Source CLI against a real local server, one project: thread count 41; thread list 41 (was 4,113); --include-archived 4,113; --archived 4,072; --thread <archived id> still returns it.

AGENT GENERATED

bb thread count excludes archived threads while bb thread list included
them, so the two disagreed (41 counted vs 4,113 listed in one project).
The CLI now sends archived=false unless --archived, the new
--include-archived, or explicit --thread IDs are given. The route default
is unchanged because SDK callers such as storage-retention rely on it.

Fold the duplicate project-list filter builder into buildListThreadsFilters.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ymichael
ymichael merged commit 151b0c2 into main Nov 3, 2026
51 checks passed
@ymichael
ymichael deleted the bb/exclude-archived-threads-from-bb-thread-list-by-thr_sipei3j4m9 branch November 3, 2026 00:39
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.

1 participant