Skip to content

Release YI (v0.51.679): parallelize fresh sidebar boot fetches (#4992, fixes #4759) - #4996

Merged
nesquena-hermes merged 4 commits into
masterfrom
stage/4992-parallel-boot
Jun 26, 2026
Merged

nesquena-hermes merged 4 commits into
masterfrom
stage/4992-parallel-boot

Conversation

@nesquena-hermes

Copy link
Copy Markdown
Collaborator

Release YI (v0.51.679) — faster fresh sidebar boot

Ships #4992 (@rodboev) — fixes #4759 (bug+performance: opening a new tab is slow to populate the sidebar).

What it fixes

Cold boot fetched /api/sessions then /api/projects sequentially. They're independent reads, so they now run concurrently (project fetch kicked off immediately, awaited after the session fetch).

Gate

  • Codex: SAFE TO SHIP — the two endpoints are independent reads (neither consumes the other's payload); a rejected project fetch is caught inside projectPromise and falls back to {projects:_allProjects||[]} so it can't reject the boot or drop sessions; the session-fetch error/timeout/scope path is unchanged; result assembly into renderSessionList is identical to the sequential version. No regression risk.
  • Full suite: 10693 passed, 0 failures. +330 tests (parallel happy path + project-fetch-failure-still-renders-sessions).
  • Pre-merge head re-check: gated == live (c071da4).

Credit @rodboev.

@greptile-apps

greptile-apps Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This release PR ships a targeted performance fix for the sidebar cold-boot path: the /api/sessions and /api/projects requests, which were previously sequential, are now fired concurrently via a new _loadSidebarSessionListPayload helper. The project fetch is kicked off immediately as an IIFE-wrapped promise and awaited only after the session fetch settles.

  • static/sessions.js: Extracts _loadSidebarSessionListPayload, starts projectPromise synchronously before awaiting the session fetch, preserving all existing error-handling (project failures fall back to _allProjects, session errors propagate to _runRenderSessionListRefresh's catch block unchanged).
  • tests/test_issue4759_parallel_sidebar_boot_fetch.py: New 330-test file covering parallel call ordering, project-fetch failure fallback, cold-boot timeout/retry options, and warm-refresh opts.
  • tests/test_issue4766_sidebar_source_pushdown.py / test_session_sidebar_resilience.py: Updated to inject the new _loadSidebarSessionListPayload helper function alongside _runRenderSessionListRefresh since _runRenderSessionListRefresh now delegates to it.

Confidence Score: 5/5

Safe to merge — a focused extraction of two independent fetches into a concurrent helper with unchanged error semantics on both the success and failure paths.

The project promise IIFE catches its own errors so it can never propagate to the session caller; if the session fetch itself throws, the abandoned project promise still resolves internally (no unhandled rejection). The generation guard and profile-switch embargo in _runRenderSessionListRefresh are untouched. The _showAllProfiles and _sessionListHasLoadedOnce reads inside the new helper are evaluated synchronously before any await, giving consistent results. Four targeted Node harness tests directly verify parallel call ordering, project-failure fallback, cold-boot timeout/retry policy, and warm-refresh opts.

No files require special attention.

Important Files Changed

Filename Overview
static/sessions.js Extracts _loadSidebarSessionListPayload to fire /api/projects concurrently with /api/sessions; error handling and generation/embargo guards are preserved.
tests/test_issue4759_parallel_sidebar_boot_fetch.py New test file with 4 Node.js harness tests validating parallel call ordering, project failure fallback, cold-boot opts, and warm-refresh opts — all assertions are logically sound.
tests/test_issue4766_sidebar_source_pushdown.py Adds _ensure_async helper and injects _loadSidebarSessionListPayload into the scope_mismatch test so _runRenderSessionListRefresh can resolve its new dependency.
tests/test_session_sidebar_resilience.py Updates text-search assertions to match the refactored structure: delegates/call-site assertions moved to the new helper, structural assertions updated accordingly.
CHANGELOG.md Adds v0.51.679 release entry describing the parallel fetch change; changelog update is correct per the release process.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant RSL as renderSessionList()
    participant RR as _runRenderSessionListRefresh()
    participant LS as _loadSidebarSessionListPayload()
    participant API_S as /api/sessions
    participant API_P as /api/projects

    RSL->>RR: call (opts, gen)
    RR->>LS: call (sessionListQS, sessionRequestOpts)
    
    Note over LS: BEFORE (sequential)
    LS->>API_S: await api(sessions)
    API_S-->>LS: sessData
    LS->>API_P: await api(projects)
    API_P-->>LS: projData
    
    Note over LS: AFTER (parallel)
    LS->>API_P: start projectPromise (IIFE, no await yet)
    LS->>API_S: await api(sessions)
    API_S-->>LS: sessData
    API_P-->>LS: projData (already in flight)
    LS-->>RR: "{sessData, projData}"
    
    Note over LS: Project failure path
    API_P--xLS: error caught internally
    LS-->>RR: "{sessData, projData:{projects:_allProjects||}}"
    
    RR->>RSL: _applySessionListPayload(sessData, projData)
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant RSL as renderSessionList()
    participant RR as _runRenderSessionListRefresh()
    participant LS as _loadSidebarSessionListPayload()
    participant API_S as /api/sessions
    participant API_P as /api/projects

    RSL->>RR: call (opts, gen)
    RR->>LS: call (sessionListQS, sessionRequestOpts)
    
    Note over LS: BEFORE (sequential)
    LS->>API_S: await api(sessions)
    API_S-->>LS: sessData
    LS->>API_P: await api(projects)
    API_P-->>LS: projData
    
    Note over LS: AFTER (parallel)
    LS->>API_P: start projectPromise (IIFE, no await yet)
    LS->>API_S: await api(sessions)
    API_S-->>LS: sessData
    API_P-->>LS: projData (already in flight)
    LS-->>RR: "{sessData, projData}"
    
    Note over LS: Project failure path
    API_P--xLS: error caught internally
    LS-->>RR: "{sessData, projData:{projects:_allProjects||}}"
    
    RR->>RSL: _applySessionListPayload(sessData, projData)
Loading

Reviews (1): Last reviewed commit: "Release YI (v0.51.679): parallelize fres..." | Re-trigger Greptile

@nesquena-hermes
nesquena-hermes merged commit b9cea92 into master Jun 26, 2026
11 checks passed
@nesquena-hermes
nesquena-hermes deleted the stage/4992-parallel-boot branch June 26, 2026 15:11
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.

bug(perf): opening a new tab in the desktop app is slow to populate sidebar session list + chat toolbar (cold-boot, slower than a browser tab)

2 participants