Skip to content

[Bug] Sessions intermittently disappear: limit=5 trimming + session.created event causes session list churn #382

@Astro-Han

Description

@Astro-Han

What happened?

Session list in the sidebar intermittently loses sessions during normal use. With 92 root sessions, only 5 are shown by default. Clicking "Load more" expands the list, but creating a new session trims the oldest one out again — sessions appear and disappear unpredictably.

Root cause (verified)

Four layers of root cause identified:

  1. limit: 5 default (child-store.ts:197): each workspace has an independent limit of 5. For the pawwork project with 92 root sessions, 84 (91%) are trimmed from view.
  2. session.created event triggers trimming (event-reducer.ts:114): every new session creation calls trimSessions(limit=store.limit), removing the oldest visible session.
  3. loadSessions early return skips server re-fetch (global-sync.tsx:194-204): when sessionMeta.limit >= store.limit, it only re-trims the in-memory list without fetching from the server. Sessions removed by event-driven trimming are not auto-recovered — only clicking "Load more" brings them back.
  4. backfillExecutionContext bulk-updates time_updated (execution-context-store.ts:8-21): sets all old sessions' time_updated to the same timestamp, causing them to simultaneously fall outside the 4-hour recency window.

Items 1–3 are product behavior issues; item 4 is a data side effect that amplifies the impact.

Steps to reproduce

  1. Open PawWork in a directory with many sessions (>20)
  2. Only 5 sessions are visible by default
  3. Click "Load more" several times to expand the limit — more sessions appear
  4. Create a new session → the oldest visible session disappears
  5. Trimmed sessions do not come back unless "Load more" is clicked again

Expected

  • Default limit should be large enough to avoid hiding 90%+ of sessions
  • session.created event should not trigger trimming, or trimming should only apply beyond the current limit boundary
  • "Load more" button should be more discoverable

Version

v2026.5.2

OS

macOS 26.3.1

Reproducible

Yes, every time

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Blocking / highest priorityappApplication behavior and product flowsbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions