Repository navigation
Conversation
cocolord
force-pushed
the
trae/model-error-phase1
branch
from
November 10, 2026 13:44
dcd8bcb to
8c7089c
Compare
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
cocolord
force-pushed
the
trae/model-error-phase1
branch
from
November 16, 2026 04:21
0d1b79b to
b8448d0
Compare
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
This branch has not been deployed
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.
Summary
Classify structured provider business errors and project existing
ModelErrorKindvalues to public protocol errors on top of #6921.ModelErrorKind; the server no longer maintains a separate fallback table or silently defaults an unmapped kind toINTERNAL.MiniMax has two distinct error paths. Non-2xx responses keep their real
response.status_codethroughrequests/httpxand bypass provider business-code classification. The documented business errors (1002,1004, etc.) are carried inbase_resp.status_codeinside an HTTP 200 response, so_sdk_kindclassifies that provider-scoped body code instead of treating HTTP 200 as an error status.Provider business-code recognition uses the same
_sdk_kindflow as OpenAI, Ark, LiteLLM, Gemini, httpx, and requests._sdk_kindfirst consumes an existing carried kind; onlyUNKNOWNconsults the data-driven_PROVIDER_CODE_KINDSlookup byprovider/code. MiniMax is one table entry, not a conditional branch. The adapter only carries its existingproviderand rawcode, and the separatemodel_error_from_codepath has been removed.Classification remains nearest-first.
ModelErrorand SDK exceptions share one classification loop. Protocol mapping consumes the resulting kind without reclassifying provider business codes: upstream error status wins when available; otherwisekind.protocol_codeis exhaustive. A status-less timeout is still distinguished from a normal connection failure using the exception chain.map_exception, VikingDB handling,model_retry.py, andcircuit_breaker.pyare unchanged.Code meanings follow the MiniMax error-code reference and the official ChatCompletionResp schema, whose only declared response is HTTP 200 and whose
base_resp.status_codefield lists the business errors.Verification
mainat5f53cbf011.main.test_model_retry.py,test_error_mapping.py,test_minimax_embedder_simple.py, andtest_gemini_embedder.py).1004 -> UNAUTHENTICATED/401, MiniMax1002 -> RESOURCE_EXHAUSTED/429, status-less timeout/connection separation, Gemini status 400 precedence, explicit-kind precedence, unknown-provider behavior, and provider/code metadata retention. No probes are added to the repository.ModelErrorKindconstruction and JSON serialization were checked under Python 3.10.git diff --checkpass. Current-head CI checks.