fix(agent-runner): log when an errored batch is acked completed

A provider error inside a consumed batch is acked completed after the
catch block, so the log shows "Query error" followed by "Completed N
message(s)" that reads like success. The only trace the user gets is
the error chat message; operators grepping the log see a clean run.

Add one log line in the error path saying the batch will be acked
completed with no redelivery. No status semantics change: flipping
errored batches to failed would silently stop recurring tasks
(recurrence fan-out gates on completed), so that stays out per review
feedback on the previous shape of this PR.
This commit is contained in:
glifocat
2026-07-10 12:42:55 +00:00
parent 14f528c895
commit 93d3908575
+5
View File
@@ -279,6 +279,11 @@ export async function runPollLoop(config: PollLoopConfig): Promise<void> {
thread_id: routing.threadId,
content: JSON.stringify({ text: `Error: ${errMsg}` }),
});
// The batch is still acked completed below (no redelivery). Without
// this line the only log trace of the errored turn is "Query error"
// followed by a "Completed" line that reads like success.
log(`Errored batch will be acked completed — ${processingIds.length} message(s), no redelivery`);
} finally {
clearCurrentInReplyTo();
}