Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions apps/server/src/provider/Drivers/ClaudeCheckBacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,19 @@ function asString(value: unknown): string | undefined {
return typeof value === "string" && value.trim().length > 0 ? value : undefined;
}

const CHECK_BACK_TOOLS: ReadonlySet<string> = new Set([
"ScheduleWakeup",
"CronCreate",
"CronDelete",
"CronList",
]);

/** Whether a Claude tool sets, cancels or lists check-backs. These schedule
* Claude's own return, never change a file, whatever their names say. */
export function isClaudeCheckBackTool(toolName: string): boolean {
return CHECK_BACK_TOOLS.has(toolName);
}

/**
* Remember what a scheduling tool call set, from its input and its
* structured result (`tool_use_result`). Other tools are ignored.
Expand Down
7 changes: 6 additions & 1 deletion apps/server/src/provider/Layers/ClaudeAdapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1728,7 +1728,12 @@ describe("ClaudeAdapterLive", () => {
durable: false,
},
} as unknown as SDKMessage);
yield* Fiber.join(created);
const createdItem = yield* Fiber.join(created);
// Scheduling a check-back is a tool call, not a file change.
assert.equal(
createdItem?.type === "item.completed" ? createdItem.payload.itemType : null,
"dynamic_tool_call",
);
const turnDone = yield* nextEvent("turn.completed");
harness.query.emit({
type: "result",
Expand Down
6 changes: 6 additions & 0 deletions apps/server/src/provider/Layers/ClaudeAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ import {
import {
claudeCheckBackTrigger,
claudeCheckBacksFromSessionCrons,
isClaudeCheckBackTool,
makeClaudeCheckBackState,
recordClaudeScheduleTool,
type ClaudeCheckBackState,
Expand Down Expand Up @@ -1718,6 +1719,11 @@ function classifyToolItemType(toolName: string): CanonicalItemType {
if (taskTrackerToolKind(normalized) !== undefined) {
return "dynamic_tool_call";
}
// Check-back tools schedule Claude's own return; "CronCreate" and
// "CronDelete" must not fall into the "create"/"delete" keywords either.
if (isClaudeCheckBackTool(toolName)) {
return "dynamic_tool_call";
}
if (normalized.includes("agent")) {
return "collab_agent_tool_call";
}
Expand Down
Loading