#Someone help me review & merge my Pull Request
1 messages · Page 1 of 1 (latest)
Looked through the patch series for #39578 (downloaded the full .patch and scanned the diffs).
What this PR does (as I understand it)
- Adds a timeout retry path for
compactEmbeddedPiSessionDirect():- if the initial compaction times out, it calls
session.abortCompaction(), - waits (bounded) for the background compaction promise to settle,
- if it actually succeeded just-after-timeout, it uses that result (skips retry),
- otherwise it truncates oversized tool results in-memory and retries compaction once with a shorter timeout.
- if the initial compaction times out, it calls
- Adds a small UX improvement: emits chunk progress events during multi-stage summarization and shows
(i/n)in the UI “Compacting context…” toast. - Extends the session lock maxHoldMs so the watchdog doesn’t force-expire the lock during the full “timeout → settle wait → retry” path.
Review feedback
âś… The retry approach looks reasonable
- Using
truncateOversizedToolResultsInMessages()is a nice “reduce context, then retry” strategy, and it’s scoped to tool results (which are the usual culprit for huge transcripts). - Good catch on the race: a timed-out
withTimeout()doesn’t stop the underlyingsession.compact()promise, so without aborting you can get stalereplaceMessages()after the retry.