Agent Zero AI framework
Polish DOX prose to match frdel imperative-contract pattern
linkliti296c7095ea4c
diff --git a/extensions/python/agent_init/AGENTS.md b/extensions/python/agent_init/AGENTS.mdindex 474d1d169..c8c64d17b 100644--- a/extensions/python/agent_init/AGENTS.md+++ b/extensions/python/agent_init/AGENTS.md@@ -12,8 +12,8 @@- Keep initialization idempotent for contexts that may be restored or reloaded.- Preserve ordering between initial message creation and profile settings loading.-- `_10_initial_message.py` adds a placeholder user turn (`fw.initial_user_message.md`) before the AI greeting (`fw.initial_message.md`) so `output_langchain` does not pop the greeting as a leading `AIMessage`. Do not remove either prompt without replacing the turn-order guarantee.-- `_10_initial_message.py` minifies the initial AI message JSON before storage; raw text is preserved as the displayed greeting when JSON parsing fails.+- Keep a placeholder user turn (`fw.initial_user_message.md`) ahead of the AI greeting (`fw.initial_message.md`) so `output_langchain` never pops the greeting as a leading `AIMessage`; do not remove either prompt without replacing the turn-order guarantee.+- Minify the initial AI message JSON before storage; preserve raw text as the displayed greeting when JSON parsing fails.## Work Guidancediff --git a/extensions/python/message_loop_result/AGENTS.md b/extensions/python/message_loop_result/AGENTS.mdindex 59ff7d054..f87835d35 100644--- a/extensions/python/message_loop_result/AGENTS.md+++ b/extensions/python/message_loop_result/AGENTS.md@@ -7,7 +7,8 @@## Ownership- Extensions receive mutable `result_data` with `llm_result` and may set `skip_default_processing` after fully handling the turn.-- `_20_empty_response.py` retries turns with no response content: fully empty turns count toward the unusable-response limit without adding a warning to model history and use `fw.msg_empty_response.md` for agent-prefixed UI warning text only; reasoning-only turns add an agent-facing `fw.msg_reasoning_only.md` history warning with a separate `fw.msg_reasoning_only_response.md` user notice and are counted by the stop-unusable-response-loop extension.+- `_20_empty_response.py` retries fully empty turns (no response and no reasoning): count them toward the unusable-response limit without adding a warning to model history, and use `fw.msg_empty_response.md` for agent-prefixed UI warning text only.+- `_20_empty_response.py` retries reasoning-only turns: add an agent-facing `fw.msg_reasoning_only.md` history warning with a separate `fw.msg_reasoning_only_response.md` user notice, and count them through the stop-unusable-response-loop extension.- `_30_repeat_response.py` retries response content that exactly matches `loop_data.last_response`, regardless of reasoning, using `fw.msg_repeat.md` for history and `fw.msg_repeat_response.md` for the agent-prefixed UI warning text.## Local Contractsdiff --git a/plugins/_a0_connector/AGENTS.md b/plugins/_a0_connector/AGENTS.mdindex d7a42fa73..124b607ef 100644--- a/plugins/_a0_connector/AGENTS.md+++ b/plugins/_a0_connector/AGENTS.md@@ -14,8 +14,7 @@## Local Contracts-- `tools/text_editor_remote.py` overrides `get_log_object()` to log `type="text_editor"` so the WebUI routes its messages through the `_text_editor` plugin's `get_message_handler` JS extension, keeping remote edits visually consistent with local edits.-+- `tools/text_editor_remote.py` logs `type="text_editor"` through a `get_log_object()` override so the WebUI routes its messages through the `_text_editor` plugin's `get_message_handler` JS extension; keep remote edits visually consistent with local edits.- Preserve session-auth and `auth.handlers` activation assumptions.- Keep remote tool prompts synchronized with remote tool behavior and disclosethem only from connected CLI metadata: no connected CLI hides all remote tooldiff --git a/plugins/_context_doctor/AGENTS.md b/plugins/_context_doctor/AGENTS.mdindex 81cc873d5..b55a331b8 100644--- a/plugins/_context_doctor/AGENTS.md+++ b/plugins/_context_doctor/AGENTS.md@@ -18,7 +18,8 @@- Repaired and fallback JSON is always minified.- Nonempty non-tool output becomes `{"thoughts":[raw]}`; XML-like output becomes `{}` only when suppression is enabled.- Blank-line-separated thoughts expand into separate entries after repair when the split strategy is enabled (default on).-- A raw-text fallback conversion emits a `fw.msg_thoughts_fallback.md` history warning and a separate `fw.msg_thoughts_fallback_response.md` user notice, refreshes the generating log and response item with the transformed thoughts JSON, then sets `skip_default_processing` so the retry advances the unusable-response counter. The fallback warning is counted by the core stop-unusable-response loop alongside `fw.msg_misformat.md`, `fw.msg_repeat.md`, `fw.msg_empty_response.md`, and `fw.msg_reasoning_only.md`.+- A raw-text fallback conversion must emit a `fw.msg_thoughts_fallback.md` history warning and a separate `fw.msg_thoughts_fallback_response.md` user notice, refresh the generating log and response item with the transformed thoughts JSON, and set `skip_default_processing` so the retry advances the unusable-response counter.+- The fallback warning is counted by the core stop-unusable-response loop alongside `fw.msg_misformat.md`, `fw.msg_repeat.md`, `fw.msg_empty_response.md`, and `fw.msg_reasoning_only.md`.- Log kvps retain streamed `reasoning` and `thoughts`, then add transformed output; `update_log` controls only View Details content.- A repaired `response` tool call refreshes the response log item when streaming did not create it.- Runtime setup reads the `json_repair` pin from root `requirements.txt`; do not duplicate its version in plugin code.diff --git a/plugins/_text_editor/AGENTS.md b/plugins/_text_editor/AGENTS.mdindex 912a53c3c..1e0e7688e 100644--- a/plugins/_text_editor/AGENTS.md+++ b/plugins/_text_editor/AGENTS.md@@ -13,8 +13,7 @@## Local Contracts-- `tools/text_editor.py` overrides `get_log_object()` to log `type="text_editor"` so the WebUI `get_message_handler` extension hook can route messages to `_text_editor/extensions/webui/get_message_handler/_10_text_editor_handler.js` instead of the default `drawMessageTool` handler.-+- `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.- Preserve stale-read protection before patch operations.- Validate patch structures before applying edits.- Read back changed regions after writes or patches where the tool contract requires confirmation.diff --git a/prompts/AGENTS.md b/prompts/AGENTS.mdindex 5dedb8b2e..5ddfea4ac 100644--- a/prompts/AGENTS.md+++ b/prompts/AGENTS.md@@ -26,7 +26,7 @@schemas.- Summary prompts that compress history should preserve loaded skill names from `skill_instructions` metadata without copying full skill bodies.- `Agent.read_prompt` and `Agent.parse_prompt` strip trailing newlines from returned content, so prompt template files may safely keep a final newline. Do not rely on trailing newlines for formatting; render-time joins in `output_text()` already separate turns.-- `fw.initial_user_message.md` supplies the placeholder user turn (`Hello!`) added by `extensions/python/agent_init/_10_initial_message.py` before the AI greeting from `fw.initial_message.md`. The user-first pair guarantees `output_langchain` does not pop the greeting as a leading `AIMessage`, so the initial message appears on both project and non-project paths. Do not remove either prompt without replacing the turn-order guarantee.+- `fw.initial_user_message.md` owns the placeholder user turn (`Hello!`) that `extensions/python/agent_init/_10_initial_message.py` pairs before the AI greeting from `fw.initial_message.md`; the user-first ordering guarantees `output_langchain` does not pop the greeting as a leading `AIMessage` on project or non-project paths. Do not remove either prompt without replacing the turn-order guarantee.- `fw.msg_reasoning_only.md` and `fw.msg_reasoning_only_response.md` own the reasoning-only turn warning pair used by `extensions/python/message_loop_result/_20_empty_response.py`.## Work Guidancediff --git a/webui/components/messages/AGENTS.md b/webui/components/messages/AGENTS.mdindex cae4076bd..72621d3f5 100644--- a/webui/components/messages/AGENTS.md+++ b/webui/components/messages/AGENTS.md@@ -24,7 +24,7 @@- Message-window boundaries must not split process groups. Groups with more than 50 steps initially render their newest 50 steps and prepend earlier steps in 50-step increments through the group-local `Show more` control while retaining stable full-group header metrics.- The process-group `Show more` paging control uses the same understated, non-underlined typography and hover-opacity treatment as message-body expansion controls.- A root response may attach only to a substantive process render unit. Utility-prefixed units remain visible even while utility steps are hidden; standalone utility-only groups remain separate and hidden while utility messages are disabled, and completed groups must not absorb later utility records. Determine this from full-log render metadata, not partially mounted DOM children.-- The `EXE` accent class for `code_exe` process steps was removed from `process-group.css`; `code_exe` items fall back to the default process-step accent. Plugin-local accent overrides (such as `TXT` for `text_editor`) continue to live next to their owning plugin.+- Do not add an `EXE` accent class for `code_execution_tool` process steps to `process-group.css`; `code_execution_tool` items use the default process-step accent. Plugin-local accent overrides (such as `TXT` for `text_editor`) live next to their owning plugin.## Work Guidancediff --git a/webui/js/AGENTS.md b/webui/js/AGENTS.mdindex 063aefd81..6d343f70b 100644--- a/webui/js/AGENTS.md+++ b/webui/js/AGENTS.md@@ -17,8 +17,8 @@- `initFw.js` owns Alpine bootstrap and custom lifecycle directives such as `x-create`, `x-destroy`, and periodic `x-every-*` hooks.- `icons.js` owns `<x-icon>`, icon-name validation, the name property/attribute bridge, and helpers that read or update both the first-party custom element and legacy plugin ligature spans.- `messages.js` owns native message/process-step rendering, safe Markdown and HTML conversion, and KaTeX delimiter handling.-- `messages.js` routes unknown/non-tool message types through `drawMessageTool` (the same renderer used for explicit tool steps) instead of the legacy default renderer; visible text is unchanged but the tool-step chrome is reused for visual consistency and unified action-button placement.-- `messages.js` disables `Scroller` smooth scrolling for `GEN` process steps (live agent responses) to prevent jumpiness during streamed content growth; non-`GEN` steps keep smooth scrolling.+- `messages.js` owns routing of unknown/non-tool message types through `drawMessageTool` (the renderer shared with explicit tool steps) for unified tool-step chrome and action-button placement; the legacy default renderer is not used.+- `messages.js` owns `Scroller` smooth-scroll suppression for `GEN` process steps (live agent responses) to prevent streamed-content jumpiness; non-`GEN` steps keep smooth scrolling.- `message-collapse.js` owns the layout-safe overflow measurement shared by collapsible user messages and responses.- `message-window.js` owns the bounded, tail-first raw-log window used by message rendering.- `loading-indicators.js` owns reusable DOM factories for shared loading visuals.