Skip to content

Commit ce52d3c

Browse files
committed
Print the completed-steps transcript inline on a failed/partial delegate_gemini run instead of only summarizing a step count -- the transcript is already checkpointed to Redis and returned by runInvestigation, it just wasn't being surfaced in the response text
1 parent ba9fd7a commit ce52d3c

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

connectors/gemini/tools.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,17 @@ export function register(server) {
126126
}
127127
}
128128

129-
return { content: [{ type: "text", text: `${result.answer}\n\n(${result.steps} step(s) taken)${notionNote}` }], isError: !!result.failed };
129+
// On a failed/partial run, the tool calls already completed are real
130+
// work (and already checkpointed to Redis -- see runInvestigation's
131+
// comment) that shouldn't be thrown away. Print them here instead of
132+
// just a step count, so the caller can see what was actually found
133+
// before the failure without needing a resume_run_id round-trip or
134+
// log_to_notion just to inspect them.
135+
const transcriptBlock = result.failed && result.transcript?.length
136+
? `\n\nTool calls completed before the failure:\n${result.transcript.join("\n")}`
137+
: "";
138+
139+
return { content: [{ type: "text", text: `${result.answer}${transcriptBlock}\n\n(${result.steps} step(s) taken)${notionNote}` }], isError: !!result.failed };
130140
}
131141
);
132142
}

0 commit comments

Comments
 (0)