mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-24 12:04:56 -07:00
Disallow Object.create() and reflect. (#22408)
This commit is contained in:
committed by
GitHub
parent
e3df87cf1a
commit
ef5627eece
@@ -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