From 0e94c230eec1869e777497c2df21ca2cee6a3aa4 Mon Sep 17 00:00:00 2001 From: ymq Date: Tue, 11 Aug 2026 13:13:36 +0800 Subject: [PATCH] debug: trace auto-inject behavior --- pipeline_service/agent_loop_v2.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pipeline_service/agent_loop_v2.py b/pipeline_service/agent_loop_v2.py index 716852b..4221a94 100644 --- a/pipeline_service/agent_loop_v2.py +++ b/pipeline_service/agent_loop_v2.py @@ -136,6 +136,14 @@ class AgentExecutor: action_type = act.get("action", "") if action_type == "reply": + # debug: always emit count + yield json.dumps({ + "type": "debug", + "tool_call_count": self._tool_call_count, + "turn": self._turn_count, + "action": action_type, + }, ensure_ascii=False) + "\n" + # 任何轮次,只要没成功调过工具就 reply → 强制注入工具调用 if self._tool_call_count == 0: hint_tool = "diagnose_project"