Runtime: stabilize tool/run state transitions under compaction and backpressure

Synthesize runtime state transition fixes for compaction tool-use integrity and long-running handler backpressure.

Sources: #33630, #33583

Co-authored-by: Kevin Shenghui <shenghuikevin@gmail.com>
Co-authored-by: Theo Tarr <theodore@tarr.com>
This commit is contained in:
Tak Hoffman
2026-03-03 21:25:32 -06:00
committed by GitHub
parent 575bd77196
commit 9889c6da53
15 changed files with 1090 additions and 21 deletions

View File

@@ -58,6 +58,8 @@ function sleep(ms: number): Promise<void> {
});
}
const DISCORD_TYPING_MAX_DURATION_MS = 20 * 60_000;
export async function processDiscordMessage(ctx: DiscordMessagePreflightContext) {
const {
cfg,
@@ -430,6 +432,8 @@ export async function processDiscordMessage(ctx: DiscordMessagePreflightContext)
error: err,
});
},
// Long tool-heavy runs are expected on Discord; keep heartbeats alive.
maxDurationMs: DISCORD_TYPING_MAX_DURATION_MS,
});
// --- Discord draft stream (edit-based preview streaming) ---