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:
2026-10-25 11:32:56 +01:00
co-authored by Claude Opus 5.5
parent 93896646c7
commit d7f88d8dd3
22 changed files with 293 additions and 19 deletions
+5 -1
View File
@@ -34,6 +34,7 @@ import composeJobBrief from "./compose-job-brief";
import grabSessionCarryOver from "./grab-session-carry-over";
import jobSessionId from "@/src/functions/backend/db/bots-queue/job-session-id";
import withTakeOverRefs from "./with-take-over-refs";
import stripAppRecords from "@/src/utils/strip-app-records";
import ScheduledRunFailedError from "./scheduled-run-failed-error";
import type { BotJobContext, BotJobOutcome } from "./types";
import computerRunDirs from "@/src/utils/computer-work-dirs";
@@ -272,12 +273,15 @@ export default async function runBotTask({
throw new ScheduledRunFailedError(computer ? computer.redact(failure) : failure);
}
const text = stripAppRecords({ text: result.text });
return {
...withTakeOverRefs({
text: computer ? computer.redact(result.text) : result.text,
text: computer ? computer.redact(text) : text,
refs: take_overs,
}),
attachments: attachments.length ? attachments : undefined,
tool_log: result.tool_uses,
};
} finally {
await extensions?.close();