fix: 实时上报 Codex 工具事件

This commit is contained in:
Codex
2026-06-02 03:23:16 +08:00
parent 9b2c637b64
commit 5544db96fb
5 changed files with 73 additions and 19 deletions
+14
View File
@@ -134,6 +134,20 @@ for await (const line of rl) {
respond(message.id, { turn });
continue;
}
if (mode === "slow-tool-events") {
turnCounter += 1;
const turn = { id: `turn_selftest_${turnCounter}`, status: "completed" };
notify("turn/started", { turn });
notify("item/started", { item: { id: "tool_selftest", type: "commandExecution", command: "sleep 0.05 && echo live" } });
notify("item/commandExecution/outputDelta", { itemId: "tool_selftest", delta: "live output\n" });
setTimeout(() => {
notify("item/completed", { item: { id: "tool_selftest", type: "commandExecution", command: "sleep 0.05 && echo live", status: "completed" } });
notify("item/agentMessage/delta", { itemId: "msg_selftest", delta: "done" });
notify("turn/completed", { turn });
respond(message.id, { turn });
}, 50);
continue;
}
turnCounter += 1;
const turn = { id: `turn_selftest_${turnCounter}`, status: "completed" };
notify("turn/started", { turn });