fix: avoid blocking on the task that just started

When an assistant turn emits both confirm and start_next, confirm may
already start the newly queued proposal. The later start_next then sees
the just-started task as an active blocker and appends a false running-task correction. Suppress that redundant start_next correction when confirm in the same turn already started the current user proposal. Also tighten the worker bootstrap wording to run confirmed low-risk work continuously until a real decision point.
This commit is contained in:
zenord
2026-08-22 00:15:32 +08:00
parent 9ae2639660
commit e9f1d595fa
3 changed files with 20 additions and 0 deletions
+13
View File
@@ -721,6 +721,19 @@ test("start_next reports when the queue is empty instead of claiming a start", a
}
});
test("confirm plus start_next in the same assistant turn does not treat the just-started task as a blocker", async () => {
const harness = await createHarness();
try {
await harness.manager.prompt(request("create proposal: hang", "user-a"));
const reply = await harness.manager.prompt(request("confirm and start next", "user-a"));
assert.doesNotMatch(reply.text, /还有一个任务正在执行/);
assert.equal(reply.text, "confirmed");
assert.equal(harness.proposals.list()[0]!.status, "working");
} finally {
await closeHarness(harness);
}
});
test("image attachments reach the assistant as image blocks when the agent supports them", async () => {
const harness = await createHarness();
try {
+1
View File
@@ -85,6 +85,7 @@ const app = acp.agent({ name: "fake-acp-agent" })
const goal = userText.slice("create proposal:".length).trim();
response = assistantEnvelope("proposal drafted", [{ type: "create_proposal", title: "Test proposal", goal, steps: ["step 1"] }]);
} else if (userText === "confirm") response = assistantEnvelope("confirmed", [{ type: "confirm" }]);
else if (userText === "confirm and start next") response = assistantEnvelope("confirmed", [{ type: "confirm" }, { type: "start_next" }]);
else if (userText === "finish") response = assistantEnvelope("finishing", [{ type: "finish" }]);
else if (userText.startsWith("follow up:")) response = assistantEnvelope("following up", [{ type: "follow_up", instruction: userText.slice("follow up:".length).trim() }]);
else if (userText.startsWith("adjust proposal:")) response = assistantEnvelope("adjusting", [{ type: "adjust_proposal", title: userText.slice("adjust proposal:".length).trim() }]);