Files
openclaw/packages
Peter Steinberger ac2f8a8dce fix(ai): provider terminal errors show as generic unknown error and trigger pointless failover (#123151)
* fix(ai): preserve provider terminal error message in stream transports

The managed OpenAI Responses transport (and the mistral/google-shared
providers) threw a literal "An unknown error occurred" on terminal
error stop reasons, discarding the provider's terminal fact (for example
"Provider incomplete_reason: content_filter"). The catch-side
projectProviderError() then overwrote output.errorMessage with the
generic string, so users saw an unknown error and failover classified
the deterministic failure as a transient timeout, rotating models and
re-sending the same filtered prompt.

Align all three sites with the canonical siblings
(openai-responses-shared.ts, transport-stream-shared.ts) by preserving
output.errorMessage when present.

* test(ai): await the transport stream factory before result()

* fix(ai): narrow the repair to the managed OpenAI transport

ClawSweeper correctly noted the mistral and google-shared edits were
no-ops: streamMistral never assigns output.errorMessage and the Google
path throws its own constructed terminal error before this fallback.
Revert both to keep the PR scoped to the proven managed-transport
repair.
2026-08-13 19:29:50 -07:00
..