@@ -684,6 +684,7 @@ async def execute(self, ctx: NodeContext) -> NodeResult:
684684 queen_input_requested ,
685685 request_system_prompt ,
686686 request_messages ,
687+ reported_to_parent ,
687688 ) = await self ._run_single_turn (
688689 ctx , conversation , tools , iteration , accumulator
689690 )
@@ -885,6 +886,7 @@ async def execute(self, ctx: NodeContext) -> NodeResult:
885886 and not outputs_set
886887 and not user_input_requested
887888 and not queen_input_requested
889+ and not reported_to_parent
888890 )
889891 if truly_empty and accumulator is not None :
890892 missing = self ._get_missing_output_keys (
@@ -1803,12 +1805,13 @@ async def _run_single_turn(
18031805 bool ,
18041806 str ,
18051807 list [dict [str , Any ]],
1808+ bool ,
18061809 ]:
18071810 """Run a single LLM turn with streaming and tool execution.
18081811
18091812 Returns (assistant_text, real_tool_results, outputs_set, token_counts, logged_tool_calls,
18101813 user_input_requested, ask_user_prompt, ask_user_options, queen_input_requested,
1811- system_prompt, messages).
1814+ system_prompt, messages, reported_to_parent ).
18121815
18131816 ``real_tool_results`` contains only results from actual tools (web_search,
18141817 etc.), NOT from synthetic framework tools such as ``set_output``,
@@ -1840,6 +1843,7 @@ async def _run_single_turn(
18401843 ask_user_prompt = ""
18411844 ask_user_options : list [str ] | None = None
18421845 queen_input_requested = False
1846+ reported_to_parent = False
18431847 # Accumulate ALL tool calls across inner iterations for L3 logging.
18441848 # Unlike real_tool_results (reset each inner iteration), this persists.
18451849 logged_tool_calls : list [dict ] = []
@@ -1993,6 +1997,7 @@ async def _do_stream(
19931997 queen_input_requested ,
19941998 final_system_prompt ,
19951999 final_messages ,
2000+ reported_to_parent ,
19962001 )
19972002
19982003 # Execute tool calls — framework tools (set_output, ask_user)
@@ -2194,6 +2199,7 @@ async def _do_stream(
21942199
21952200 elif tc .tool_name == "report_to_parent" :
21962201 # --- Report from sub-agent to parent (optionally blocking) ---
2202+ reported_to_parent = True
21972203 msg = tc .tool_input .get ("message" , "" )
21982204 data = tc .tool_input .get ("data" )
21992205 wait = tc .tool_input .get ("wait_for_response" , False )
@@ -2475,6 +2481,7 @@ async def _timed_subagent(
24752481 queen_input_requested ,
24762482 final_system_prompt ,
24772483 final_messages ,
2484+ reported_to_parent ,
24782485 )
24792486
24802487 # --- Mid-turn pruning: prevent context blowup within a single turn ---
@@ -2506,6 +2513,7 @@ async def _timed_subagent(
25062513 queen_input_requested ,
25072514 final_system_prompt ,
25082515 final_messages ,
2516+ reported_to_parent ,
25092517 )
25102518
25112519 # Tool calls processed -- loop back to stream with updated conversation
0 commit comments