Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/provider/inference-dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,6 @@ export function createInferenceDependencies(): Promise<Dependencies> {
.then((deps) => ({
...deps,
fetch: withCodexContentTypeRepair(deps.fetch),
// Compose the first-party doom-loop exemptions into the single liveness
// hook the vendored reactor already consumes: still-pending polls and
// idempotent task bookkeeping both reset the repeat streak instead of
// counting toward the fail-run threshold.
isPollOnlyPendingBatch: (calls, results) =>
isPollOnlyPendingBatch(calls, results) ||
isIdempotentTaskBatch(calls, results),
Expand Down
13 changes: 3 additions & 10 deletions src/subagent/idempotent-task-exempt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,9 @@ import type { ToolCall, ToolResult } from "@intx/types/runtime";

/**
* Doom-loop exemption for idempotent task bookkeeping. A batch is exempt only
* when it is non-empty and every executed call is a task-bookkeeping tool
* (`manage_tasks` — `isSameTool` folds the `todowrite` and `update_plan`
* aliases onto that engine id).
*
* Repeating an identical task update is legitimate bookkeeping, not a runaway
* loop: "finalize checklist" three times changes nothing and should not
* abort an otherwise-finished run under the `fail-run` policy. This resets
* the doom-loop streak (same mechanism as the poll exemption) so consecutive
* task-only batches never accumulate toward the threshold, while any real
* tool in the batch counts normally and always preserves the guard.
* when it is non-empty and every call is a task-bookkeeping tool
* (`manage_tasks` — `isSameTool` folds `todowrite` and `update_plan`).
* Mixed batches return false so the guard counts them normally.
*/
export function isIdempotentTaskBatch(
calls: readonly ToolCall[],
Expand Down
Loading