Skip to content

Commit b47a754

Browse files
authored
Merge pull request #82 from Tarquinen/fix/gemini-tool-name-resolution
Fix Gemini tool name resolution and session restore
2 parents 207a84a + b533a98 commit b47a754

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/fetch-wrapper/formats/gemini.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,10 @@ export const geminiFormat: FormatDescriptor = {
8787
const toolCallId = positionMapping.get(positionKey)
8888

8989
if (toolCallId) {
90+
const metadata = state.toolParameters.get(toolCallId.toLowerCase())
9091
outputs.push({
9192
id: toolCallId.toLowerCase(),
92-
toolName: funcName
93+
toolName: metadata?.tool
9394
})
9495
}
9596
}

lib/fetch-wrapper/handler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ export async function handleFormat(
7171
const sessionId = ctx.state.lastSeenSessionId
7272
const protectedSet = new Set(ctx.config.protectedTools)
7373
if (sessionId) {
74+
await ensureSessionRestored(ctx.state, sessionId, ctx.logger)
7475
await syncToolCache(ctx.client, sessionId, ctx.state, ctx.toolTracker, protectedSet, ctx.logger)
7576
}
7677

0 commit comments

Comments
 (0)