fix: don't trigger LLM turns on async_bash job completion (#875) (#880)

This commit is contained in:
Tom Boucher 2026-03-17 10:30:13 -04:00 committed by GitHub
parent 62bbaa8e8e
commit 7e1fcd3549

View file

@ -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" },
);
},
});