Repository navigation
fix: distinguish permanent and retryable token validation failures - #7546
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
1 issue found across 4 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/reflex-hosting-cli/src/reflex_cli/utils/exceptions.py">
<violation number="1" location="packages/reflex-hosting-cli/src/reflex_cli/utils/exceptions.py:19">
P2: `TokenAccessDeniedError` inherits this `True` default even though `_validate` uses it for 401/403 refusals, so callers inspecting `retryable` can wrongly treat a rejected token as retryable. Set this subclass's value to `False`.</violation>
</file>
Contributor
|
Merging this PR will not alter performance
|
masenf
approved these changes
Oct 16, 2026
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.
Refs #7537.
Token validation mapped every API status other than 401/403 to
TokenValidationError("server error"), so a permanent failure such as a malformed request got the same "try again later" advice as a transient one.This keeps the HTTP status and splits the result into retryable (for example 5xx) and permanent, so the guidance matches. Nothing else about validation changes.
The API's error detail is intentionally not surfaced: it can echo the token. So this covers the HTTP status and the retryable vs permanent split only, not the API's own explanation from the issue. That part of #7537 is left open, which is why this says "Refs" and not "Closes".
Added tests in
tests/units/reflex_cli/utils/test_hosting.py, including checks that the token does not appear in the error. An independent review environment ran them with the existing unit suite (790 passed); I did not run them myself. I did not run lint or the full CI matrix locally; CI will.News fragment included.
All Submissions:
Type of change