feat: apply_patch tool for openai models (#9127)

This commit is contained in:
Aiden Cline
2026-01-17 22:35:09 -08:00
committed by GitHub
parent 10433cb45b
commit b7ad6bd839
16 changed files with 1122 additions and 496 deletions

View File

@@ -685,7 +685,10 @@ export namespace SessionPrompt {
},
})
for (const item of await ToolRegistry.tools(input.model.providerID, input.agent)) {
for (const item of await ToolRegistry.tools(
{ modelID: input.model.api.id, providerID: input.model.providerID },
input.agent,
)) {
const schema = ProviderTransform.schema(input.model, z.toJSONSchema(item.parameters))
tools[item.id] = tool({
id: item.id as any,

View File

@@ -5,6 +5,7 @@ You are an interactive CLI tool that helps users with software engineering tasks
## Editing constraints
- Default to ASCII when editing or creating files. Only introduce non-ASCII or other Unicode characters when there is a clear justification and the file already uses them.
- Only add comments if they are necessary to make a non-obvious block easier to understand.
- Try to use apply_patch for single file edits, but it is fine to explore other options to make the edit if it does not work well. Do not use apply_patch for changes that are auto-generated (i.e. generating package.json or running a lint or format command like gofmt) or when scripting is more efficient (such as search and replacing a string across a codebase).
## Tool usage
- Prefer specialized tools over shell for file operations: