fix(agents): warn when a database agent is built without a description - #84
Open
antiv wants to merge 1 commit into
Open
fix(agents): warn when a database agent is built without a description#84antiv wants to merge 1 commit into
antiv wants to merge 1 commit into
Conversation
`description` is nullable on agents_config and nothing requires it, so an agent built with `description=''` is a normal reachable state — not an edge case. ADK uses that field as the routing signal when a parent LLM agent picks a sub-agent to delegate to, so an empty one degrades delegation silently: the agent constructs fine, shows up in the tree, and is simply never routed to. No error, no log line, nothing in the dashboard. Log a warning at build time when an agent inside a tree resolves to an empty description, so it surfaces at startup rather than at delegation time. Scoped to agents that have sub-agents or are themselves sub-agents — a lone root agent delegates nowhere and would only add noise to every start. Behaviour is otherwise unchanged: no derived fallback description, since invented text would steer ADK's routing in a way nobody asked for. Closes #79 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #79
Problem
AgentManager._initialize_agentfalls back to an empty string when a database-backed agent config has no description, and passes it straight to the constructor for every agent type.ADK uses
descriptionas the routing signal when a parent LLM agent decides which sub-agent to delegate to. An agent built withdescription=''still constructs, still appears in the tree, but the parent has nothing to route on — so delegation to it degrades silently. No error, no log line, nothing in the dashboard.descriptionisnullable=Trueonagents_configand nothing in the dashboard or API requires it, so this is a normal reachable state rather than an edge case.Change
Option 1 from the issue: log a warning at build time in
shared/utils/agent_manager.py, right where the fallback happens, so the problem surfaces at startup instead of at delegation time.The warning is scoped to agents that have sub-agents or are themselves sub-agents — both directions named in the issue. A lone root agent delegates nowhere and would only add noise to every start.
Deliberately not included: a derived fallback description (option 2) would steer ADK's routing with invented text nobody asked for, and a dashboard validation warning (option 3) is a separate frontend change. Behaviour is otherwise unchanged — nothing is rejected, nothing is rewritten.
Tests
New
shared/test/test_agent_description_warning.py(4 tests):Full suite: 729 tests, all passing.
🤖 Generated with Claude Code