fix: agent-level retry for intermittent SSL errors during streaming

- llmcore: prefix all error outputs with !!! marker
- ga: detect !!!Error: [SSL: in tail of content as incomplete response and retry
- add len(content)>100 guard to avoid false positives on short responses
This commit is contained in:
Liang Jiaqing
2026-04-23 11:24:54 +08:00
parent 17971f642a
commit 97573e6f46
2 changed files with 4 additions and 4 deletions

2
ga.py
View File

@@ -444,7 +444,7 @@ class GenericAgentHandler(BaseHandler):
if not response or not content.strip():
yield "[Warn] LLM returned an empty response. Retrying...\n"
return StepOutcome({}, next_prompt="[System] Blank response, regenerate and tooluse")
if '未收到完整响应 !!!]' in content[-100:]:
if len(content) > 100 and ('未收到完整响应 !!!]' in content[-100:] or '!!!Error: [SSL:' in content[-100:]):
return StepOutcome({}, next_prompt="[System] Incomplete response. Regenerate and tooluse.")
if 'max_tokens !!!]' in content[-100:]:
return StepOutcome({}, next_prompt="[System] max_tokens limit reached. Use multi small steps to do it.")