Skip to content

fix: retry transport errors without misclassifying model text - #803

Open
Fwind43 wants to merge 2 commits into
lsdefine:mainfrom
Fwind43:fix/no-tool-error-prefix-retry
Open

fix: retry transport errors without misclassifying model text#803
Fwind43 wants to merge 2 commits into
lsdefine:mainfrom
Fwind43:fix/no-tool-error-prefix-retry

Conversation

@Fwind43

@Fwind43 Fwind43 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Why

Short transport errors such as !!!Error: ConnectionError: empty response could be mistaken for a final answer. Matching more text prefixes would instead misclassify legitimate model-generated text.

What

  • Tag internally generated diagnostics with LLMError (a string subclass preserving streaming/display compatibility).
  • Propagate transport/parser errors through content-block metadata into MockResponse.error for native and text-tool clients.
  • Use error provenance, not response text, for no-tool error retries, history exclusion and mixed-session fallback.
  • Suppress tool calls from failed/partial responses before tool parsing.
  • Preserve bounded application retries and existing transport backoff; no new dependencies.

Testing

  • python -m unittest discover -s tests: 11 tests pass.
  • Covers identical error text from the model vs transport, parser diagnostics, native/text clients, history, mixed-session fallback, partial tools and bounded retries.
  • py_compile for ga.py and llmcore.py; git diff --check passes.
  • Synthetic transport responses only; no live LLM requests.

Supersedes the initial prefix-matching approach in this PR.

@Fwind43 Fwind43 changed the title fix(ga): retry error-only responses in no-tool handling fix: retry transport errors without misclassifying model text Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant