Serialize function calls that mutate state (#8513)

This commit is contained in:
Tommaso Sciortino
2025-09-17 11:45:04 -07:00
committed by GitHub
parent efb57e1cef
commit e76dda37ad
4 changed files with 331 additions and 8 deletions

View File

@@ -167,6 +167,7 @@ Signal: Signal number or \`(none)\` if no signal was received.
}
export class ToolRegistry {
// The tools keyed by tool name as seen by the LLM.
private tools: Map<string, AnyDeclarativeTool> = new Map();
private config: Config;
private mcpClientManager: McpClientManager;

View File

@@ -532,6 +532,14 @@ export enum Kind {
Other = 'other',
}
// Function kinds that have side effects
export const MUTATOR_KINDS: Kind[] = [
Kind.Edit,
Kind.Delete,
Kind.Move,
Kind.Execute,
] as const;
export interface ToolLocation {
// Absolute path to the file
path: string;