You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regression: session startup/resume stuck at 'loading transcript' until a manual reload #283
On app startup (rehydrate) and on continuing a killed session (resume), the pane is stuck at "loading transcript" indefinitely. Running a manual reload command clears it. Regression — worked before.
Root-cause investigation (so far)
The transcript-load lifecycle has an asymmetric state-write bug:
But it only writes the terminal `'ready'` (~line 256) / `'error'` (~line 295) inside an `if (!current) return prev` guard (lines 144 and 290).
So if the session's runtime entry is rebuilt / dropped / renamed while the async load is in flight, the `'ready'` write is silently discarded and the pane stays at `'loading'` forever. A manual reload re-runs the load against a now-stable id, which is why it unsticks.
Why the manual reload path works but auto doesn't
`reloadAgentSessions` (the manual path) does its id-remap `setRuntimes` first, then calls the loader last under the stable new id. The auto paths interleave the loader with state rebuilds.
Prime suspect for the drop
`commitRehydratedState` (`src/renderer/src/workspace/hook/persistence/rehydrate.ts:374-`) is the only wholesale runtimes rebuild in the codebase — it returns a fresh `out = {}` map. Every other `setRuntimes` is additive `{...prev}`. A load-vs-rebuild ordering race here (or in the resume/`replaceSession` path) would orphan the in-flight loader's `'ready'` write.
Likely regression window: "Stream initial history loading" (`4765e51`, introduced the async slot/streaming load) and/or the #248 id-remap commits (`f85cfa5`/`ae42bd7`/`49472fb`).
Status
Every ordering traced on paper still preserves the id, so this is a genuine async race (or an unread path). Next step is diagnostic instrumentation (separate PR) that logs every `transcriptStatus` transition + flags when the loader resolve finds its runtime gone and when `commitRehydratedState` drops an in-flight `'loading'` key — reproduce once, read the timeline, then fix at the source.
Acceptance
Startup and resume reach `transcriptStatus: 'ready'` automatically (no manual reload).
No regression to live streaming / ghost reconciliation.
Activity
Merge pull request #284 from Juliusolsson05/diag/transcript-loading-s…
fix(lifecycle): resolve two-reviewer adversarial review of PR #627