-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Bug Description
When a sub-agent calls agent_finish to complete its task and report results, the parent agent does not receive or process the completion report. The sub-agent's report is added to _agent_messages[parent_id] queue, but the parent agent never acknowledges or processes it.
Expected Behavior
When a sub-agent calls agent_finish with report_to_parent=True, the parent agent should:
- Receive the completion report
- Acknowledge the sub-agent's completion
- Process the findings and recommendations from the report
Actual Behavior
The sub-agent's completion report is added to the message queue (_agent_messages[parent_id]), but:
- The parent agent never receives the report
- The report remains "unread" in the queue
- The parent agent continues its execution without acknowledging sub-agent completion
- Sub-agents may repeatedly send messages thinking they weren't delivered
Root Cause Analysis
Code Location: strix/tools/agents_graph/agents_graph_actions.py
The agent_finish function (lines 424-443) only adds messages to _agent_messages[parent_id]:
if parent_id not in _agent_messages:
_agent_messages[parent_id] = []
_agent_messages[parent_id].append({
"id": f"report_{uuid4().hex[:8]}",
"from": agent_id,
"to": parent_id,
"content": report_message,
"message_type": "information",
"priority": "high",
"timestamp": datetime.now(UTC).isoformat(),
"delivered": True,
"read": False,
})Code Location: strix/agents/base_agent.py
The _check_agent_messages function (lines 427-510) only processes messages when the parent agent is in a waiting state:
if state.is_waiting_for_input():
state.resume_from_waiting()
has_new_messages = TrueThe Problem
- Parent agents create sub-agents and continue executing (they don't automatically enter waiting state)
- Sub-agents finish and call
agent_finish - Messages are added to
_agent_messages[parent_id]queue - Parent agent's
_check_agent_messagesis called every loop iteration - Messages are added to
state.messagesand marked as read - But parent agent is NOT in waiting state, so it doesn't specially process these completion reports
- Parent agent continues execution without acknowledging sub-agent completion
Proposed Fix
Modify agent_finish to directly add the completion report to the parent agent's state.messages:
# After adding to _agent_messages, also add directly to parent's state
if parent_id in _agent_states:
parent_state = _agent_states[parent_id]
parent_state.add_message("user", report_message)This ensures the parent agent will see the completion report in its next LLM iteration, regardless of its waiting state.
Impact
- High: Sub-agent reports are critical for multi-agent workflows
- Affects all users relying on sub-agent delegation
- Sub-agents may appear "stuck" as they wait for acknowledgment
Environment
- Strix version: 0.6.2
- Python version: 3.13
- OS: Kali Linux
Additional Context
This issue was discovered during penetration testing where sub-agents completed deep fuzzing and TLS analysis tasks, but their reports were never received by the parent agent, requiring manual intervention to merge the reports.