diff --git a/src/node/services/tools/advisor.test.ts b/src/node/services/tools/advisor.test.ts index ab308ae02a..2237e148d2 100644 --- a/src/node/services/tools/advisor.test.ts +++ b/src/node/services/tools/advisor.test.ts @@ -345,10 +345,13 @@ describe("advisor tool", () => { "## Advisor Handoff\n\n" + `**Question:** ${question}\n\n` + "**Current-step commentary:**\nVisible commentary about the current step.\n\n" + - "**Current-step reasoning:**\nInternal reasoning about coordination and race conditions.\n\n" + - `**Pending tool call:**\nadvisor(${JSON.stringify(snapshot.input)})`, + "**Current-step reasoning:**\nInternal reasoning about coordination and race conditions.", }, ]); + + const handoffText = getHandoffText(streamTextSpy); + expect(handoffText).not.toContain("**Pending tool call:**"); + expect(handoffText).not.toContain('advisor({"question":'); }); it("consumes the frozen snapshot exactly once for the current tool call", async () => { diff --git a/src/node/services/tools/advisor.ts b/src/node/services/tools/advisor.ts index 83557ba44f..83940bcec9 100644 --- a/src/node/services/tools/advisor.ts +++ b/src/node/services/tools/advisor.ts @@ -41,12 +41,6 @@ function tailTruncate(value: string, maxChars: number): string { return `...${value.slice(-(maxChars - 3))}`; } -function formatPendingToolCall(input: Record): string { - const serializedInput = JSON.stringify(input); - assert(serializedInput != null, "advisor handoff input must be JSON serializable"); - return `advisor(${serializedInput})`; -} - function buildAdvisorHandoffMessage( question: string | undefined, snapshot: AdvisorToolCallSnapshot | undefined @@ -78,14 +72,6 @@ function buildAdvisorHandoffMessage( sections.push(`**Current-step reasoning:**\n${stepReasoning}`); } - if (snapshot != null) { - assert( - snapshot.toolName === "advisor", - "advisor handoff snapshot must come from the advisor tool" - ); - sections.push(`**Pending tool call:**\n${formatPendingToolCall(snapshot.input)}`); - } - return { role: "user", content: sections.join("\n\n"),