From f64daa96cd0f85ea9b595f5e4d2316ae076b3a63 Mon Sep 17 00:00:00 2001 From: YueGuobin Date: Wed, 4 Mar 2026 23:34:14 +0800 Subject: [PATCH] feat(agent): streamline conversation flow logic in copilot - Remove unused `llm_calls` variable and redundant logging in `should_continue` - Simplify title generation routing by eliminating unnecessary condition checks - Improve code clarity and maintainability by focusing on essential flow control --- gns3server/agent/gns3_copilot/agent/gns3_copilot.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/gns3server/agent/gns3_copilot/agent/gns3_copilot.py b/gns3server/agent/gns3_copilot/agent/gns3_copilot.py index 9b15d8207..69fd58f04 100644 --- a/gns3server/agent/gns3_copilot/agent/gns3_copilot.py +++ b/gns3server/agent/gns3_copilot/agent/gns3_copilot.py @@ -345,7 +345,6 @@ def should_continue( - Otherwise → conversation is complete, go to END """ last_message = state["messages"][-1] - llm_calls = state.get("llm_calls", 0) current_title = state.get("conversation_title") # LLM requested one or more tool executions @@ -354,9 +353,6 @@ def should_continue( # First full interaction completed and title not yet generated if current_title in [None, "New Conversation"]: - logger.info( - "First turn finished, no title yet → routing to 'title_generator_node'" - ) return "title_generator_node" # Normal completion (multi-turn conversation or title already exists)