mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-04 23:27:00 -07:00
Disallow Object.create() and reflect. (#22408)
This commit is contained in:
committed by
GitHub
parent
b5f6417574
commit
e3fdc290d0
@@ -243,10 +243,10 @@ export class GeminiCliSession {
|
||||
|
||||
const loopContext: AgentLoopContext = this.config;
|
||||
const originalRegistry = loopContext.toolRegistry;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const scopedRegistry: ToolRegistry = Object.create(originalRegistry);
|
||||
const scopedRegistry: ToolRegistry = originalRegistry.clone();
|
||||
const originalGetTool = scopedRegistry.getTool.bind(scopedRegistry);
|
||||
scopedRegistry.getTool = (name: string) => {
|
||||
const tool = originalRegistry.getTool(name);
|
||||
const tool = originalGetTool(name);
|
||||
if (tool instanceof SdkTool) {
|
||||
return tool.bindContext(context);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user