block / block/berd

Sidebar projects show zero chats when their sessions fall outside the first session page

Open
#259 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
909
Forks
116
Avg merge
1d 1h
Merged PRs (30d)
156

Description

### Before filing
- [x] I searched open and closed issues for duplicates.
- [x] I reproduced this on the latest release.
- [x] This is one bug, not several bundled together.

**Closest existing issue:** none found (Linear: BOT-1688, BOT-959, BOT-1521)

### What's broken
When a user has more sessions than one backend page (50), sidebar projects whose most recent chat falls outside the first page render as empty ("No chats yet"), even though the project has chats. The sidebar groups sessions into projects from only the sessions currently loaded in the store, and the background auto-loader stops at 60 sessions — so projects appear empty and stay that way.

### Steps to reproduce
1. Launch Berd
2. Have more than ~60 sessions, with at least one project whose most recent chat is older than the 60 most recent sessions overall
3. Look at that project in the sidebar

### What you expected to happen
The project should show its chats regardless of how many other sessions exist.

### What actually happened
The project shows zero chats. `session/list` returns 50/page, activity-desc, with no project filter (`crates/goose/src/acp/server/list_sessions.rs:15`). Startup `loadSessions()` fetches page 1 only (`src/features/chat/stores/chatSessionStore.ts:780-796`). The sidebar groups projects from the loaded slice (`src/features/sessions/capabilities/SessionListCapability.tsx:265-313`). The background auto-loader stops at `MAX_AUTO_LOADED_GROUPED_CHATS = 60` (`SessionListCapability.tsx:80-81,906-909`), so with hundreds of sessions the project never hydrates. Goose-scheduler-generated sessions accelerate this by pushing real chats further down the feed.

### How often does it happen?
Every time — reliably reproducible (for users with enough sessions)

### Berd version
0.6.2

### Operating system
macOS (Apple Silicon)

### Model and provider
n/a

### Relevant log output
no relevant log output

### Screenshots, recordings, or other context
Reported by multiple users across versions (Linear BOT-1688 / BOT-959 / BOT-1521; Slack https://sq-block.slack.com/archives/C0B63ARP20K/p1788218186714219). Note: BOT-959's earlier fix (`useProjectSessionHydration`, squareup/goose-internal#580) is not present in this repo.

Durable fix: query sessions per project rather than grouping the global feed. That needs a `project_id` filter on `session/list` — a goose backend change (`SessionListFilters` currently lacks it, though the `project_id` column exists and is indexed) — tracked separately upstream. Once available, each expanded project issues `session/list?projectId=X` and renders that, making the sidebar immune to scheduler churn. The "View all chats" gating bug (#256) and search-coverage bug (#257) are related but independent.

Contributor guide

Open the contributing guide

Research direction

Start with loadSessions() in src/features/chat/stores/chatSessionStore.ts and the project grouping and auto-loader in src/features/sessions/capabilities/SessionListCapability.tsx. Then inspect crates/goose/src/acp/server/list_sessions.rs and the current session list filters. Done means a project with chats outside the first 50 or 60 sessions displays those chats reliably, including when scheduler sessions push them down the feed.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, typescript
Domain
api, backend, frontend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.