Repository navigation
fix: expose typed provider failure details in errors - #246
Merged
Merged
Conversation
danielkov
enabled auto-merge (squash)
October 13, 2026 10:59
Typed agentkit provider failures already carry a sanitized reason, HTTP status, allowlisted upstream error type/code and attempt count, but the fatal log and the ACP/prompt error text collapsed them into a bare "provider request failed". Render those fields and use the failure reason as the fatal record code.
danielkov
force-pushed
the
fix/expose-provider-errors
branch
from
October 13, 2026 11:03
2da87b4 to
de2006b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Typed provider failures (
LoopError::ProviderFailure) already carry sanitized, payload-free data: failure reason, last attempt reason, HTTP status, allowlisted upstreamtype/code, and attempt count. Kit threw all of it away. The fatal record and the error surfaced to ACP/prompt clients both collapsed it toprovider request failed.That hid the ChatGPT backend's 401s during today's outage, where every Codex request failed with
invalid_api_key. The error log recorded onlyprovider_error, so diagnosing it took a live reproduction.Changes in
src/fatal.rs:codeis now the failure reason (http_status,authentication,retry_exhausted, …) instead of the genericprovider_error.provider request failed: http_status (HTTP 401, invalid_request_error/invalid_api_key, attempts: 2)provider request failed: retry_exhausted after http_status (HTTP 503, attempts: 12)Every field comes from agentkit's allowlisted enums, so no response bodies, URLs, or credentials reach the log. Legacy string errors and cancellation behave as before.
Follow-up in agentkit: the HTTP non-2xx path sets only
http_statusand doesn't parse the body'serror.type/error.codeinto the allowlisted kinds, so HTTP 401s still show only the status. The WebSocket and SSEresponse.failedpaths already classify them.