mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-22 19:14:33 -07:00
Disallow redundant typecasts. (#15030)
This commit is contained in:
committed by
GitHub
parent
fcc3b2b5ec
commit
942bcfc61e
@@ -707,7 +707,7 @@ export class AgentExecutor<TOutput extends z.ZodTypeAny> {
|
||||
|
||||
for (const [index, functionCall] of functionCalls.entries()) {
|
||||
const callId = functionCall.id ?? `${promptId}-${index}`;
|
||||
const args = (functionCall.args ?? {}) as Record<string, unknown>;
|
||||
const args = functionCall.args ?? {};
|
||||
|
||||
this.emitActivity('TOOL_CALL_START', {
|
||||
name: functionCall.name,
|
||||
@@ -918,10 +918,10 @@ export class AgentExecutor<TOutput extends z.ZodTypeAny> {
|
||||
toolNamesToLoad.push(toolRef);
|
||||
} else if (typeof toolRef === 'object' && 'schema' in toolRef) {
|
||||
// Tool instance with an explicit schema property.
|
||||
toolsList.push(toolRef.schema as FunctionDeclaration);
|
||||
toolsList.push(toolRef.schema);
|
||||
} else {
|
||||
// Raw `FunctionDeclaration` object.
|
||||
toolsList.push(toolRef as FunctionDeclaration);
|
||||
toolsList.push(toolRef);
|
||||
}
|
||||
}
|
||||
// Add schemas from tools that were registered by name.
|
||||
|
||||
Reference in New Issue
Block a user