Group of 2 Under the hood
API error responses now include a typed apiError code (and often apiErrorParams) instead of just a human-readable message
What
- Many request/auth error branches in the API-error formatter now attach a machine-readable
apiErrorcode (and sometimesapiErrorParams) alongside the existing human-readable message. This covers tool-use concurrency conflicts, duplicate or orphanedtool_useids, using an effort setting without thinking enabled, advisor-model incompatibility, disabled API-key auth, and provider credential failures for Bedrock, Vertex, and Foundry (which now include aremedyparam). - The catch-all error handler now classifies more failure modes with their own typed
apiErrorcodes instead of lumping them into a generic error:no_response,tls_untrusted_ca,gateway_content_type(a Bedrock proxy rewriting the event stream),provider_credentials(withapiErrorParams: {provider, remedy: 'host_managed'}), andgateway_signin_required/gateway_session_expired(withremedy: 'gateway_token'when the token came from the environment). Previously most of these produced a genericserver_error/unknownmessage with no machine-readable cause.
Why Typed error codes let tooling and error handling react to the specific cause of an API failure instead of just showing a generic message, making it easier to tell the user what went wrong and how to fix it.