mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-08-23 23:37:05 +00:00
Introduce a WebUI extension manifest and rewrite the asset bundler/server to support caller-supplied entry sets, extension-injected entries, and negotiated gzip. Key changes: add get_webui_extension_manifest() to helpers/extension, refactor Stop logic into stop_context() and reuse it from the connector `/stop` command, and add a new `/rename` slash command for chat naming. ui_bundler now accepts entry_urls, includes enabled extension entry files, raises the embedded text file size limit to 512 KiB, computes per-entry-set cache keys, and returns a bundle version based on the bundle signature. ui_server applies Starlette GZip middleware, adds routes (/, /index.html, /ui/index, /safe), serves splash/safe documents, injects the serialized webui_extension_manifest into the rendered index, and streamlines the /ui/asset-bundle endpoint with ETag and gzip handling. Also add multiple WebUI assets and fonts, new/updated plugin command YAML and Python command handlers, and corresponding tests covering bundling, commands, chat naming, and WebUI behaviors. Documentation (.dox.md) updated to reflect the new runtime contracts and guidance.
1.4 KiB
1.4 KiB
stop.py DOX
Purpose
- Own the authenticated WebUI endpoint that stops an active agent run without deleting or resetting its chat context.
Ownership
stop.pyresolves the requested in-memory context and exposes the sharedstop_context()operation used by the endpoint and slash command.
Runtime Contracts
Stopderives fromApiHandler, retaining the default authentication and CSRF protections.- Input uses the selected chat ID in
context; the endpoint never creates a missing context. - Stopping cancels the context task through
AgentContext.kill_process(), clears pause state, preserves chat history and queued messages, and does not start another run. - The endpoint clears active progress and logs a terminal
Agent process stopped.info step so the WebUI closes the interrupted process group. - The response contains
message,context, and astoppedboolean indicating whether the context was running when requested. - Other authenticated entry points should call
stop_context()so cancellation, progress cleanup, and terminal logging remain identical to the Stop button.
Work Guidance
- Keep this endpoint aligned with the composer stop-button state and the existing
AgentContexttask lifecycle.
Verification
- Run
pytest tests/test_stop_agent.pyand smoke-test stopping during model streaming and tool execution.
Child DOX Index
No child DOX files.