diff --git a/src/resources/extensions/async-jobs/index.ts b/src/resources/extensions/async-jobs/index.ts index 54f452140..24c379d1c 100644 --- a/src/resources/extensions/async-jobs/index.ts +++ b/src/resources/extensions/async-jobs/index.ts @@ -54,6 +54,14 @@ export default function AsyncJobs(pi: ExtensionAPI) { ? output.slice(0, maxLen) + "\n\n[... truncated, use await_job for full output]" : output; + // Deliver as follow-up without triggering a new LLM turn (#875). + // When the agent is streaming: the message is queued and picked up + // by the agent loop's getFollowUpMessages() after the current turn. + // When the agent is idle: the message is appended to context so it's + // visible on the next user-initiated prompt. Previously triggerTurn:true + // caused spurious autonomous turns — the model would interpret completed + // job output as requiring action and cascade into unbounded self-reinforcing + // loops (running more commands, spawning more jobs, burning context). pi.sendMessage( { customType: "async_job_result", @@ -64,7 +72,7 @@ export default function AsyncJobs(pi: ExtensionAPI) { ].join("\n"), display: true, }, - { deliverAs: "followUp", triggerTurn: true }, + { deliverAs: "followUp" }, ); }, });