fix(backend,frontend): record WHY a review failed, not just that it failed - #9
Open
exos-marc wants to merge 1 commit into
Open
fix(backend,frontend): record WHY a review failed, not just that it failed#9exos-marc wants to merge 1 commit into
exos-marc wants to merge 1 commit into
Conversation
…ailed Classify the pipeline's caught exception into a reason TOKEN instead of the constant "unhandled_exception", and prefer reason-keyed copy over stage-keyed copy in the UI. - ModelInvocationError carries the provider status as a structured .status_code attribute; classification reads it rather than regex-matching the message string. - The status NUMBER stops at the backend. Only the token crosses the API; the frontend maps the token to prose, so no raw HTTP status reaches user-facing copy. - The bare except Exception stays (fail closed, never wedge PENDING/RUNNING); classification happens inside it. An unrecognised exception still yields unhandled_exception and today's copy. Refs #442
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.
Propagates the fix landed on the private origin as
87a11ff(issue #442 there).The problem
Every pipeline failure was recorded as the constant
"unhandled_exception", so the UI could only guess. A real production review failed on an HTTP 402 — the model account was out of credits — and the UI offered three wrong guesses (bad key / model unavailable / document too long). Diagnosing it required shell access to a production container, for a condition an admin can fix in two minutes if told.The fix
model_account_out_of_credits,model_key_rejected,model_rate_limited,model_context_length_exceeded,model_unavailable), falling back tounhandled_exception.ModelInvocationErrorcarries the provider status as a.status_codeattribute; classification reads that rather than regex-matching the message, which would rot the next time the copy changes.HTTP <n>, endpoint, or key material reaches user-facing copy.except Exceptionstays — classification happens inside it — so a review still can never wedge inPENDING/RUNNING. An unrecognised exception yieldsunhandled_exceptionand today's copy, so no path regresses.Verification
tests/test_review_failure_reason_442.py(new, 16 tests) — asserts the mapping per status code and that no status number reaches the UI.unhandled_exception.bash scripts/check-frontend.sh→ CHECK-FRONTEND: ALL GREENSKIP_INFRA=1 bash scripts/check.sh→ CHECK: ALL GREENtests/lint-brand-free.pyon this branch → BRAND-FREE LINT: PASS (incl. Check 4: zeroexos-legal)🤖 Generated with Claude Code