Keep a record of each run's tool calls so bots can't claim work they never did
The wrap-up turn now gets the run's actual tool calls, each bot message keeps them as bot_messages.tool_log, and history follows recorded bot messages with an [App record] line. The coordinator also gets update_bot in workspaces, so it can fill a bot's core prompt from there. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { describe, expect, test } from "bun:test";
|
||||
import describeToolUses from "./describe-tool-uses";
|
||||
|
||||
describe("describeToolUses", () => {
|
||||
test("says none when no tool ran", () => {
|
||||
expect(describeToolUses({ uses: [] })).toBe("none");
|
||||
});
|
||||
|
||||
test("groups calls by tool, in the order first called, and marks failures", () => {
|
||||
expect(
|
||||
describeToolUses({
|
||||
uses: [
|
||||
{ name: "fetch_url", ok: true },
|
||||
{ name: "update_memory", ok: true },
|
||||
{ name: "fetch_url", ok: false },
|
||||
{ name: "fetch_url", ok: true },
|
||||
{ name: "set_bot_workspace_instructions", ok: false },
|
||||
],
|
||||
}),
|
||||
).toBe("fetch_url x3 (1 failed), update_memory, set_bot_workspace_instructions (failed)");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user