mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 15:24:58 +00:00
feat(agents): flush reply pipeline before compaction wait (#35489)
Merged via squash.
Prepared head SHA: 7dbbcc510b
Co-authored-by: Sid-Qin <201593046+Sid-Qin@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
This commit is contained in:
@@ -1688,6 +1688,14 @@ export async function runEmbeddedAttempt(
|
||||
const preCompactionSessionId = activeSession.sessionId;
|
||||
|
||||
try {
|
||||
// Flush buffered block replies before waiting for compaction so the
|
||||
// user receives the assistant response immediately. Without this,
|
||||
// coalesced/buffered blocks stay in the pipeline until compaction
|
||||
// finishes — which can take minutes on large contexts (#35074).
|
||||
if (params.onBlockReplyFlush) {
|
||||
await params.onBlockReplyFlush();
|
||||
}
|
||||
|
||||
await abortable(waitForCompactionRetry());
|
||||
} catch (err) {
|
||||
if (isRunnerAbortError(err)) {
|
||||
|
||||
Reference in New Issue
Block a user