mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 13:53:18 +08:00
重构主控编排与运行时预热链路,统一工作区提示词/专家调度协议并补齐 wiki 记忆注入与写回闭环。
同时收敛启动与运维脚本默认行为(含 wiki worker)、更新 Admin 可观测性与相关测试,降低首轮时延并提高运行稳定性。 Made-with: Cursor
This commit is contained in:
parent
4a23b715a2
commit
dbbe3add6a
14438 changed files with 2693620 additions and 2546 deletions
52
openclaw/docs/tools/apply-patch.md
Normal file
52
openclaw/docs/tools/apply-patch.md
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
---
|
||||
summary: "Apply multi-file patches with the apply_patch tool"
|
||||
read_when:
|
||||
- You need structured file edits across multiple files
|
||||
- You want to document or debug patch-based edits
|
||||
title: "apply_patch Tool"
|
||||
---
|
||||
|
||||
# apply_patch tool
|
||||
|
||||
Apply file changes using a structured patch format. This is ideal for multi-file
|
||||
or multi-hunk edits where a single `edit` call would be brittle.
|
||||
|
||||
The tool accepts a single `input` string that wraps one or more file operations:
|
||||
|
||||
```
|
||||
*** Begin Patch
|
||||
*** Add File: path/to/file.txt
|
||||
+line 1
|
||||
+line 2
|
||||
*** Update File: src/app.ts
|
||||
@@
|
||||
-old line
|
||||
+new line
|
||||
*** Delete File: obsolete.txt
|
||||
*** End Patch
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `input` (required): Full patch contents including `*** Begin Patch` and `*** End Patch`.
|
||||
|
||||
## Notes
|
||||
|
||||
- Patch paths support relative paths (from the workspace directory) and absolute paths.
|
||||
- `tools.exec.applyPatch.workspaceOnly` defaults to `true` (workspace-contained). Set it to `false` only if you intentionally want `apply_patch` to write/delete outside the workspace directory.
|
||||
- Use `*** Move to:` within an `*** Update File:` hunk to rename files.
|
||||
- `*** End of File` marks an EOF-only insert when needed.
|
||||
- Available by default for OpenAI and OpenAI Codex models. Set
|
||||
`tools.exec.applyPatch.enabled: false` to disable it.
|
||||
- Optionally gate by model via
|
||||
`tools.exec.applyPatch.allowModels`.
|
||||
- Config is only under `tools.exec`.
|
||||
|
||||
## Example
|
||||
|
||||
```json
|
||||
{
|
||||
"tool": "apply_patch",
|
||||
"input": "*** Begin Patch\n*** Update File: src/index.ts\n@@\n-const foo = 1\n+const foo = 2\n*** End Patch"
|
||||
}
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue