fix(web): sample the live-output generation before selectSession fetches (#814)

- selectSession now samples _liveOutputGen before its fresh fetch, as the refresh and manual-pull paths do, so output that arrives during the download keeps the session marked for Reload history.
- Test: live output during the fresh fetch keeps the mark after a mux-full-history replay.
This commit is contained in:
Hadrien Kerlero committed 2026-11-23 00:31:49 +01:00
1 parent 7794f74282
commit 4848886330
2 files changed
+22 -3

No files matched your search

+2 -1
View File
@@ -10557,6 +10557,8 @@ class CodemanApp {
!session?.remote && !session?.docker && !session?.adopt && this._paneHistoryLines?.get(sessionId) === 0;
const useFullHistory = !shellSession && (paneKeepsNoHistory || !this._fullHistoryLoaded.has(sessionId));
if (useFullHistory) this._fullHistoryLoaded.add(sessionId);
// Sample before fetching, as other replays do, so output during download keeps the session marked.
const liveOutputGen = this._liveOutputGen?.get(sessionId) || 0;
const fetchStartedAt = performance.now();
const tailUrl = `/api/sessions/${sessionId}/terminal?tail=${TERMINAL_TAIL_SIZE}`;
let capture;
@@ -10620,7 +10622,6 @@ class CodemanApp {
_crashDiag.log(`REWRITE: ${(data.terminalBuffer.length/1024).toFixed(0)}KB`);
this._setTerminalLoadState(sessionId, selectGen, 'replaying');
const replayStartedAt = performance.now();
const liveOutputGen = this._liveOutputGen?.get(sessionId) || 0;
this._resetTerminalForReplay();
// Truncation is reported OUT OF BAND (#258). This used to write a grey
// "... earlier output truncated ..." line into the