mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-07-09 17:08:29 +00:00
Adds the always-enabled _goal plugin with per-chat goal storage, WebUI goal strip, /goal slash command, and agent-facing goal tools. Includes command-picker integration, focused plugin tests, and the generated 256x256 thumbnail asset.
2.3 KiB
2.3 KiB
Goal Plugin DOX
Purpose
- Own the built-in chat goal strip,
/goalslash command, goal state API, and agent-facing goal tools. - Keep chat goals scoped to the active chat context and stored as user data outside tracked plugin code.
Ownership
plugin.yamlowns the always-enabled_goalplugin metadata.helpers/goals.pyowns file-backed goal storage underusr/plugins/_goal/goals/and goal status normalization.api/goal.pyowns the WebUI JSON API for reading, editing, pausing, resuming, and deleting goals.commands/owns the/goalslash command contributed to_commands.webui/andextensions/webui/own the composer goal strip and inline controls.tools/andprompts/own agent-facing goal inspection, creation, and status update behavior.extensions/python/message_loop_prompts_after/owns injecting the active goal into agent context.
Local Contracts
- Goal status values are
active,paused,complete, andblocked. - Active goals are injected into agent extras; paused and blocked goals remain visible in the UI, while complete goals are hidden.
- Goal records track accumulated active time with
elapsed_secondsandactive_since; pausing freezes elapsed time until resume. - User controls may pause, resume, edit, or delete a goal; destructive delete uses inline confirmation. Model tools may create goals and mark them complete or blocked.
/goal <objective>creates the goal and sends the objective as the user message so the agent starts working immediately./goal autofills the composer with a prompt asking the agent to create and manage its own goal instead of silently sending a message.- Goal UI feedback uses toast notifications and inline controls, not modal dialogs.
Work Guidance
- Keep goal state in
usr/plugins/_goal/; do not store runtime goal data in tracked files. - Keep the goal strip mounted through WebUI extension points instead of modifying core composer templates.
- Keep
_commandscompatibility in mind:/goalis a plugin-contributed command and should remain read-only in the command manager.
Verification
- Run
conda run -n a0 pytest plugins/_goal/testsafter changing_goalbackend behavior. - Run
_commandsdiscovery tests when changing the/goalcommand contribution contract.
Child DOX Index
No child DOX files.