Skip to content

Commit 9d65eba

Browse files
authored
gemini_investigate: raise hard step cap from 10 to 20 (#14)
* Fix gemini_investigate: use role 'user' for functionResponse turns (Gemini API rejects role 'function') * Add notion_get_page to gemini_investigate's delegated function set, so investigations can actually read page content (previously only notion_search/notion_query_database were available) * Raise gemini_investigate HARD_MAX_STEPS from 10 to 20 -- Vercel Fluid Compute defaults to a 300s function timeout, giving far more headroom than the original 10-step cap assumed * Update gemini_investigate tool description: hard cap is now 20, not 10
1 parent dabfb70 commit 9d65eba

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

connectors/gemini/delegate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { queryTelemetry } from "../cloudflare/observability.js";
2727
import { notionRequest, notionRichTextToString, notionPageTitle, notionDatabaseTitle, notionBlocksToText } from "../notion/client.js";
2828
import { DEFAULT_OWNER } from "../../config.js";
2929

30-
const HARD_MAX_STEPS = 10;
30+
const HARD_MAX_STEPS = 20;
3131

3232
// ---------------------------------------------------------------------------
3333
// Delegated function declarations -- Gemini's "tools" param (a subset of

connectors/gemini/tools.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export function register(server) {
9898
"Delegate an open-ended, multi-step READ-ONLY investigation to Gemini instead of doing it yourself one tool call at a time. Gemini runs its own loop server-side -- reading GitHub files/trees/commits, Cloudflare Workers logs, and Notion pages/databases across as many turns as it needs (bounded by max_steps) -- and returns one synthesized answer. Use this for things like \"why is CI failing on PR #42\" or \"summarize what changed in this repo over the last week\" where you'd otherwise need 5-10 separate manual tool calls. Not for anything requiring a write -- this tool is read-only by design.",
9999
{
100100
task: z.string().describe("The investigation task/question, described with enough context (repo names, time ranges, etc.) for Gemini to act without needing to ask you anything back -- it can't."),
101-
max_steps: z.number().optional().describe("Max tool-use turns Gemini gets before being forced to answer (default 6, hard cap 10 regardless of this value)."),
101+
max_steps: z.number().optional().describe("Max tool-use turns Gemini gets before being forced to answer (default 6, hard cap 20 regardless of this value)."),
102102
log_to_notion: z.boolean().optional().describe("Whether to log the task, step-by-step tool calls, and final answer as a page under the Gemini section of Notion (default: true). Write always targets the fixed Gemini root page."),
103103
},
104104
async ({ task, max_steps = 6, log_to_notion = true }) => {

0 commit comments

Comments
 (0)