Edit File
editApply an exact text replacement inside a workspace file, returning a unified diff. Replace all occurrences or target a single match, with failure on mismatched replacement counts.
Instructions
Apply a targeted exact text replacement inside a workspace text file. Returns a unified diff.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path relative to workspace root. | |
| new_text | Yes | Replacement text. | |
| old_text | Yes | Exact text to replace. Must match once unless replace_all=true. | |
| task_mode | No | Optional Task Router mode override for this edit. | |
| replace_all | No | Replace all occurrences. Default: false. | |
| workspace_id | No | Optional workspace id. When omitted, CodexPro binds the authoritative conversation workspace automatically; an explicit unknown or mismatched id is rejected. | |
| conversation_id | No | Connector conversation id bound to this workspace. Modern MCP injects it automatically; side-effecting tools require it to match the authoritative binding. | |
| task_instruction | No | Original user task. Required in progressive mode so Task Router can verify write intent. | |
| workspace_generation | No | Optional authoritative workspace generation. When omitted, CodexPro injects the conversation-bound generation; an explicit stale generation is rejected. | |
| expected_replacements | No | Fail if actual replacement count differs. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tool_result | Yes |