refactor MixinSession._raw_ask: simplify retry logic, skip yielding first-only error chunk

This commit is contained in:
Liang Jiaqing
2026-03-29 10:53:26 +08:00
parent 1d94384ee5
commit 226fa69cc3
3 changed files with 14 additions and 20 deletions

View File

@@ -91,5 +91,5 @@ def agent_runner_loop(client, system_prompt, user_input, handler, tools_schema,
next_prompt += f"<tool_result>\n{datastr}\n</tool_result>\n\n"
next_prompt += outcome.next_prompt
next_prompt = handler.next_prompt_patcher(next_prompt, None, turn+1)
messages = [{"role": "user", "content": next_prompt}]
messages = [{"role": "user", "content": next_prompt}] # just new message, history is kept in *Session
return {'result': 'MAX_TURNS_EXCEEDED'}