Skip to content

Commit 15b98a7

Browse files
committed
v1.4.16: sync Gemini CLI version to 0.44.0-nightly.20260521 and add tool call IDs
1 parent cc44111 commit 15b98a7

3 files changed

Lines changed: 20 additions & 5 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "opencode-gemini-auth",
3-
"version": "1.4.15",
3+
"version": "1.4.16",
44
"author": "jenslys",
55
"repository": "https://github.com/jenslys/opencode-gemini-auth",
66
"main": "./dist/index.js",

src/plugin/gemini-cli-version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
* Synced from `.local/gemini-cli/packages/cli/package.json`.
33
* Update with: `npm run update:gemini-cli-version`
44
*/
5-
export const GEMINI_CLI_VERSION = "0.42.0-nightly.20260428.g59b2dea0e";
5+
export const GEMINI_CLI_VERSION = "0.44.0-nightly.20260521.g57c42a5c4";

src/plugin/request/openai.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
import { randomUUID } from "node:crypto";
2+
13
interface GeminiFunctionCallPart {
24
functionCall?: {
5+
id?: string;
36
name: string;
47
args?: Record<string, unknown>;
58
[key: string]: unknown;
@@ -23,6 +26,10 @@ interface OpenAIMessage {
2326
[key: string]: unknown;
2427
}
2528

29+
function makeFunctionCallId(name: string): string {
30+
return `${name}__${randomUUID()}`;
31+
}
32+
2633
/**
2734
* Transforms OpenAI `tool_calls` to Gemini `functionCall` parts.
2835
*/
@@ -60,10 +67,12 @@ export function transformOpenAIToolCalls(requestPayload: Record<string, unknown>
6067

6168
const name = fn.name;
6269
const args = parseJsonObject(fn.arguments);
70+
const resolvedName = name ?? "";
6371
parts.push({
6472
functionCall: {
65-
name: name ?? "",
73+
name: resolvedName,
6674
args,
75+
id: makeFunctionCallId(resolvedName),
6776
},
6877
thoughtSignature: "skip_thought_signature_validator",
6978
});
@@ -99,8 +108,14 @@ export function addThoughtSignaturesToFunctionCalls(requestPayload: Record<strin
99108
continue;
100109
}
101110
const partObj = part as Record<string, unknown>;
102-
if (partObj.functionCall && !partObj.thoughtSignature) {
103-
partObj.thoughtSignature = "skip_thought_signature_validator";
111+
if (partObj.functionCall) {
112+
if (!partObj.thoughtSignature) {
113+
partObj.thoughtSignature = "skip_thought_signature_validator";
114+
}
115+
const fc = partObj.functionCall as Record<string, unknown>;
116+
if (!fc.id) {
117+
fc.id = makeFunctionCallId((fc.name as string) || "");
118+
}
104119
}
105120
}
106121
}

0 commit comments

Comments
 (0)