Skip to content

Agent Zero AI framework

Keep text editor line edits explicitly supported

Alessandro4fc6f031175d
diff --git a/plugins/_text_editor/AGENTS.md b/plugins/_text_editor/AGENTS.md
index a3d70d551..71a61d883 100644
--- a/plugins/_text_editor/AGENTS.md
+++ b/plugins/_text_editor/AGENTS.md
@@ -13,6 +13,7 @@
## Local Contracts
+- `patch` supports line-number `edits`, context `patch_text`, and exact `old_text`/`new_text` replacement. Line edits remain supported and require fresh read state; they are not deprecated.
- Text Editor `write`/`patch` read the canonical UI-intent arg `open_in_canvas`; legacy aliases `open_canvas` and `open_document` still work. Document only the canonical arg in model-facing prompts.
- `tools/text_editor.py` logs `type="text_editor"` through a `get_log_object()` override so the WebUI `get_message_handler` hook routes messages to `_text_editor/extensions/webui/get_message_handler/_10_text_editor_handler.js` instead of the default `drawMessageTool` handler.
- The remote editor reuses shipped patch and log helpers even when this plugin is disabled; activation still controls local tool discovery and custom WebUI rendering. Removing bundled helper files is not a supported independent-plugin configuration.
diff --git a/plugins/_text_editor/prompts/agent.system.tool.text_editor.md b/plugins/_text_editor/prompts/agent.system.tool.text_editor.md
index f89773a78..100a99dae 100644
--- a/plugins/_text_editor/prompts/agent.system.tool.text_editor.md
+++ b/plugins/_text_editor/prompts/agent.system.tool.text_editor.md
@@ -60,7 +60,7 @@ patch_text update-only forms:
- do not repeat the same old line as both a space-context line and a -removed line
- context lines start with space, removals with -, additions with +
- use enough unique context; add @@ anchor when repeated text exists
-edits legacy line mode: from/to inclusive, original line numbers from read, no overlaps
+edits line mode: from/to inclusive, original line numbers from read, no overlaps
edits examples: {from:2 to:2 content:"x\n"} replace; {from:2 to:2} delete; {from:2 content:"x\n"} insert before
for edits, re-read after insert/delete or line-count-changing replace
ensure valid syntax in content (all braces brackets tags closed)