Skip to content

sidebar-bootstrap ships 138KB and refetches wholesale on thread status changes #1302

Closed

Description

@SawyerHood

Found while profiling the mobile web frontend against a seeded 1,200-thread database (pnpm seed:perf, #1300).

Numbers

  • GET /api/v1/sidebar-bootstrap returns 138 KB of JSON (11.7 KB gzip) for 131 unarchived threads: ~1.1 KB per thread across 29 fields, while the sidebar renders roughly 8 of them (title, status, project, unread, pinned, provider, branch, attention time).
  • Sending one message refetched the entire payload; it refires on thread lifecycle transitions. With several concurrently active threads, every turn start/stop reparses and re-renders the whole sidebar tree — this multiplies with the drawer mount cost in Large active thread lists keep all sidebar rows mounted #1261.
  • Server time is fine (~8 ms warm); the cost is wire size, JSON parse, and the re-render it triggers on mobile CPUs.

Repro

  1. pnpm seed:perf on a dev instance.
  2. Open the app with the network panel filtered to sidebar-bootstrap.
  3. Send a message to any thread; watch the full payload refetch.

Suggested approach

  • Trim the wire shape to the fields the sidebar renders.
  • On status-change push events, patch the cached thread row instead of refetching the world; if a refetch is needed, scope it to the affected project.
  • The same push-driven patching would remove most of the ~10-request fan-out currently observed after a single send.

🤖 Generated with Claude Code

Activity

  1. added theissue type on Aug 10, 2026
  2. amadad commented on Aug 12, 2026

    @amadad
    Contributor

    Supporting scale evidence from a production 0.37.0 install: 1,071 unarchived threads are present (985 idle, 86 error). Origins include 228 automation threads and 75 workflow threads.

    Sidebar virtualization in 0.37.0 improves rendering, but it does not remove the payload/refetch invariant described here. At this scale, patching the affected thread row from lifecycle events is materially different from repeatedly transferring and parsing the full bootstrap. I support keeping payload reduction and incremental cache patching as the durable fix.

  3. SawyerHood commented on Aug 18, 2026

    @SawyerHood
    CollaboratorAuthor

    Reproduction & root-cause report: https://get-bb.github.io/reports/issues/1302.html

    • Verdict: REPRODUCED · root-cause confidence: high
    • Root cause (short): status-changed realtime pushes carry no row data and the app's registry rule for them invalidates the single monolithic sidebarNavigation query (full ThreadListEntry for every visible thread of every project, ~1 KB/row) with an immediate flush, so every turn start/end re-downloads the whole 134 KB bootstrap instead of patching one row.
    • Proposed fix: (1) Add optional status/runtime to threadChangeMetadataSchema, have every notifyThread(["status-changed"]) caller include the post-transition values, and change the app's status-changed rule to patch the row in the thread-list and sidebar caches (mirroring the existing hasPendingInteraction patch path), falling back to the current dirtyThreadListQueries only when metadata is missing or the row is not cached; server<->app only, no daemon protocol bump. (2) Introduce a trimmed sidebarThreadEntrySchema for sidebar-bootstrap threads and drop per-project sources/defaultExecutionOptions from the boo…
    • Caveats: Revision of the verified report. Major finding fixed: 1302-bb.sh (and 1302-wait-idle.sh) now unset all inherited BB_* vars, always eval the worktree's scripts/bb-dev-app env, and echo the target URL; re-tested from a shell with BB_SERVER_URL=http://127.0.0.1:38886 exported against a fresh dev instance (server :22777) — the wrapper hit :22777 and returned only that instance's host (verify/wrapper-i…

    The report has copy-paste repro steps, screenshots where the bug is visual, code permalinks at 16ceb3a54, and repro artifacts. It was independently re-run by a second agent (see its Verification section).

    AGENT GENERATED: by Claude Opus 5

  4. added
    confirmed-repro
    on Aug 18, 2026
  5. added a commit that references this issue on Aug 21, 2026
    fdfaec7
  6. self-assigned this
    on Aug 21, 2026
  7. added 3 commits that reference this issue on Aug 21, 2026
    766f192
    1774612
    e012365
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

confirmed-reproperf

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions