mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-06-02 00:57:41 +08:00
fix: tool call match
This commit is contained in:
@@ -196,6 +196,11 @@ class AgentStreamExecutor:
|
||||
# are never stripped mid-execution (which would cause LLM loops).
|
||||
self._trim_messages()
|
||||
|
||||
# Validate after trimming: trimming may leave orphaned tool_use at the
|
||||
# boundary (e.g. the last kept turn ends with an assistant tool_use whose
|
||||
# tool_result was in a discarded turn).
|
||||
self._validate_and_fix_messages()
|
||||
|
||||
self._emit_event("agent_start")
|
||||
|
||||
final_response = ""
|
||||
|
||||
Reference in New Issue
Block a user