mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-10-25 23:59:43 +00:00
The synthetic Hello! user turn was limited to the main agent, so subordinate agents started their history without the few-shot example of the response tool-call JSON. Remove the agent-number guard so every agent receives the seed turn, which the initial_seed metadata marker already keeps out of chat naming for delegated children. Validation: pytest tests/test_initial_message.py plugins/_chat_naming/tests/test_chat_naming.py (20 passed) on the framework runtime.
2.4 KiB
2.4 KiB
Agent Init Extensions DOX
Purpose
- Own backend extensions that run when an agent context initializes.
Ownership
- Ordered Python files own initial UI message setup and profile settings load behavior.
Local Contracts
- Keep initialization idempotent for contexts that may be restored or reloaded.
- Preserve ordering between initial message creation and profile settings loading.
_15_load_profile_settings.pymerges settings from low to high priority: plugin-wide files, bundled profile, plugin profiles, user profile, project-wide file, then project profile. Each plugin layer applies bundled roots before user roots with a stable root-priority sort, preserving same-root discovery order and cached lookup lists. Global framework andusr/settings.jsonfiles remain excluded; malformed layers log an error and leave other layers usable. Profile and MCP configuration inherit when not explicitly overridden.- Keep a placeholder user turn (
fw.initial_user_message.md) ahead of the AI greeting (fw.initial_message.md) sooutput_langchainnever pops the greeting as a leadingAIMessage; 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.
_10_initial_message.pypassesLLMResult.non_llm()tohist_add_ai_responseso the Responses-API state seam runs uniformly; the sentinel carries noresponse_idand marksmode=""/state="off"so stored metadata does not claim a Responses-API turn.- The synthetic
Hello!user turn has no UI log. The assistant greeting is displayed as a response log with the same ID as its history message, preserving the log/history link for branching. Keep the user-first seed without duplicating the visible greeting on reload. - Every agent receives the seed turn, including subordinate agents, where it serves as a few-shot example of the response tool-call JSON; it is marked with
initial_seedmetadata so consumers such as chat naming can exclude the synthetic turn from user-derived processing.
Work Guidance
- Coordinate changes with profile loading, settings resolution, and startup smoke checks.
Verification
- Smoke-test new chat/context initialization after changes.
- Run
tests/test_plugin_asset_precedence.pyandtests/test_subagent_profiles.pyfor profile-settings changes.
Child DOX Index
No child DOX files.