From 5e3c8617dedff5c0d2af5528e1650e5e5018fb95 Mon Sep 17 00:00:00 2001 From: user Date: Sat, 29 Aug 2026 10:12:11 +0800 Subject: [PATCH] fix(execution): treat empty initial turns as successful terminal responses A turn whose first round carries only system-injection user messages (no real user content) is finalized locally without a model request; the success whitelist only accepts max_rounds and repeated_tool_failures, so this terminal reason classifies as failure even though the turn ended exactly as designed. Add empty_initial_turn to the whitelist so locally synthesized terminal turns settle as success like the other no-model-request reasons. Note: at this baseline no production path emits empty_initial_turn yet; this is a defensive alignment so the terminal reason settles correctly once an empty-input first-round guard is introduced. Test: cargo check --locked -p bitfun-core --jobs 4 (exit 0) AI: This change was assisted by AI and lightly tested. --- .../assembly/core/src/agentic/execution/execution_engine.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crates/assembly/core/src/agentic/execution/execution_engine.rs b/src/crates/assembly/core/src/agentic/execution/execution_engine.rs index 033b552ef8..a7eb2aadb1 100644 --- a/src/crates/assembly/core/src/agentic/execution/execution_engine.rs +++ b/src/crates/assembly/core/src/agentic/execution/execution_engine.rs @@ -4980,7 +4980,7 @@ impl ExecutionEngine { let success = has_final_response || matches!( effective_finish_reason, - "max_rounds" | "repeated_tool_failures" + "max_rounds" | "repeated_tool_failures" | "empty_initial_turn" ); // Post-processing hook: when a DeepResearch dialog turn finishes