Fix Bug
This commit is contained in:
@@ -59,7 +59,9 @@ export function geminiToOpenAIResponse(chunk, state) {
|
||||
}
|
||||
|
||||
if (hasFunctionCall) {
|
||||
const fcName = part.functionCall.name;
|
||||
const rawName = part.functionCall.name;
|
||||
// Restore original tool name from mapping (AG cloaking)
|
||||
const fcName = state.toolNameMap?.get(rawName) || rawName;
|
||||
const fcArgs = part.functionCall.args || {};
|
||||
const toolCallIndex = state.functionIndex++;
|
||||
|
||||
@@ -107,7 +109,9 @@ export function geminiToOpenAIResponse(chunk, state) {
|
||||
|
||||
// Function call
|
||||
if (part.functionCall) {
|
||||
const fcName = part.functionCall.name;
|
||||
const rawName = part.functionCall.name;
|
||||
// Restore original tool name from mapping (AG cloaking)
|
||||
const fcName = state.toolNameMap?.get(rawName) || rawName;
|
||||
const fcArgs = part.functionCall.args || {};
|
||||
const toolCallIndex = state.functionIndex++;
|
||||
|
||||
|
||||
@@ -59,9 +59,11 @@ export function openaiToAntigravityResponse(chunk, state) {
|
||||
const accum = state._toolCallAccum[idx];
|
||||
let args = {};
|
||||
try { args = JSON.parse(accum.arguments); } catch { /* empty */ }
|
||||
// Restore original tool name if it was prefixed during cloaking
|
||||
const originalName = state.toolNameMap?.get(accum.name) || accum.name;
|
||||
parts.push({
|
||||
functionCall: {
|
||||
name: accum.name,
|
||||
name: originalName,
|
||||
args
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user