fix(session): harden usage accounting and memory flush recovery

This commit is contained in:
Peter Steinberger
2026-03-02 00:06:52 +00:00
parent ee96e1751e
commit d729ab2150
9 changed files with 285 additions and 33 deletions

View File

@@ -715,6 +715,11 @@ export async function runReplyAgent(params: {
queueKey,
runFollowupTurn,
);
} catch (error) {
// Keep the followup queue moving even when an unexpected exception escapes
// the run path; the caller still receives the original error.
finalizeWithFollowup(undefined, queueKey, runFollowupTurn);
throw error;
} finally {
blockReplyPipeline?.stop();
typing.markRunComplete();