Skip to content

Session switching gets progressively slower as message history grows #17775

Closed as not planned

Description

@BYK

Description

Switching between sessions becomes progressively slower the more the user has scrolled up through message history. Each round-trip (switch away, switch back) re-fetches an ever-growing number of messages from scratch.

Root cause: meta.limit in sync.tsx grows via loadMore() as the user scrolls up (200 → 400 → 600 → ...). When switching back to a session after the 15s prefetch TTL expires, a force-refresh reuses this inflated limit as the server fetch size — re-downloading the entire browsing history in a single request instead of just the latest page.

Example: user scrolls up through 1000 messages, switches away for 15s, switches back → server is asked for limit=1000 in one request. Next scroll-up grows it to 1200, next switch re-fetches 1200, etc.

Steps to reproduce

  1. Open a session with many messages (100+)
  2. Scroll up several times to load older history (each scroll triggers loadMore, growing the limit)
  3. Switch to a different session
  4. Wait 15 seconds (prefetch TTL)
  5. Switch back to the original session
  6. Observe: network request fetches all previously-loaded messages, not just the latest page
  7. Repeat steps 2-6 — each cycle gets slower

OpenCode version

1.2.26

Operating System

Any

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    perfIndicates a performance issue or need for optimization
    on Mar 16, 2026
  2. removed
    perfIndicates a performance issue or need for optimization
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  3. github-actions commented on Jul 7, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions