Skip to content

Speed up startup and show cached conversations immediately - #362

Merged
vinayagg merged 1 commit into
mainfrom
codex/faster-startup-cached-conversations
Nov 6, 2026
Merged

vinayagg merged 1 commit into
mainfrom
codex/faster-startup-cached-conversations

Conversation

@vinayagg

@vinayagg vinayagg commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

What broke
Bees startup could wait for account and directory sync before serving the UI. Opening or switching threads also waited for fresh data instead of showing the saved conversation immediately.

Why
Startup awaited the initial account refresh, and conversation access checks shared the wider organization and billing refresh path.

What changed

  • Open the UI with saved thread and directory data before starting background setup and sync.
  • Start optional dependency setup after the browser paints, sync the selected conversation first, then start remaining account sync and schedules. Keep a fallback for headless clients.
  • Show cached conversations immediately when switching threads, with a background sync indicator and protection against late responses replacing the current selection.
  • Keep cached views read-only until refreshed, isolate caches by account, cache only remote conversation text, and remove revoked previews after directory refresh.
  • Separate conversation directory checks from organization and billing updates, and keep private local reads independent of the network.

Tested

  • npm run check passed, including desktop tests, type checking, and desktop/hosted UI builds.
  • Focused tests cover startup ordering with pending dependency setup, cached data across restart, revoked previews, reads during stalled background sync, rapid thread switches, and account isolation.
  • Isolated runtime smoke test with a deliberately stalled organization sync: saved-data snapshot in 1.95 seconds, cached conversation read in 6 ms, selected startup sync in 60 ms, and another conversation read in 32 ms while background sync stayed blocked. These are local API timings, not rendered UI timings.
  • Packaged fresh-install UI timing has not been tested.

@vinayagg
vinayagg merged commit 9a1032f into main Nov 6, 2026
2 checks passed
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