fix: treat transient GitHub PAT identity checks as inconclusive#1107
Merged
anderdc merged 3 commits intoMay 12, 2026
Merged
Conversation
2f2a006 to
3b1db7f
Compare
anderdc
requested changes
May 8, 2026
Collaborator
anderdc
left a comment
There was a problem hiding this comment.
Please scope this down. Keep the check-handler change — pat_valid=None instead of False is the real semantic fix.
Drop the broadcast-handler change and its test: the _github_identity_retry_message helper, the new branch in handle_pat_broadcast, and test_transient_identity_lookup_rejected_with_retry_message. Both old and new broadcast paths reject with accepted=False and short-circuit before _test_pat_against_repo, so the new code only swaps the rejection string for a friendlier one — not enough to justify the added surface in PAT validation code.
10 tasks
4 tasks
…nto fix/pat-handler-transient-user-failure
Contributor
Author
|
Hi, @anderdc Could you please review again? Updated based on your feedback. |
This was referenced May 11, 2026
This was referenced May 12, 2026
anderdc
approved these changes
May 12, 2026
Khaostica
pushed a commit
to Khaostica/gittensor
that referenced
this pull request
May 21, 2026
Extend the transient-failure handling from entrius#1107 (identity check) to `_test_pat_against_repo` (repo test query). A GitHub 5xx burst or transport-layer hiccup (DNS, connection reset, timeout) during the GraphQL test query currently flips `pat_valid` to `False` and tells the miner their PAT failed — prompting them to rotate a working PAT. The identity-check side of this same handler was already fixed in entrius#1107 to surface transient failures as `pat_valid = None` with a retry-oriented message; the test-query side kept the old "collapse everything to invalid" behavior. Changes: - `_test_pat_against_repo` now returns a `PatTestResult` dataclass mirroring `GitHubCredentialValidation`, distinguishing transient failures (HTTP 5xx, `requests.RequestException`) from permanent ones (4xx, GraphQL errors, viewer:null scope rejection). - `handle_pat_check` surfaces transient test-query failures as `pat_valid = None` with the same retry message established by entrius#1107 for the identity path. - `handle_pat_broadcast` rejects on transient with a retry-oriented message and does not store the PAT (write was already gated on success, so no behavior change there — the message just stops pointing at the PAT as the culprit). - Tests updated for the new return type; new regression tests cover the transient 5xx path, transport-error path, and broadcast retry message.
This was referenced May 21, 2026
jakearmstrong59
added a commit
to jakearmstrong59/gittensor
that referenced
this pull request
May 29, 2026
…r check After entrius#1107 a validator emits has_pat=True, pat_valid=None on a transient GitHub failure, but _pat_check_row_category had no branch for it and collapsed it into 'no_response' — indistinguishable from a validator that never answered, in both the table and --json output. Add an 'inconclusive' category in the categorizer, the aggregate-counts dict, and the check.py status-markup map (the table does a bare _PAT_CHECK_STATUS_MARKUP[category] lookup, so the markup entry is required to avoid a KeyError). success = valid_count > 0 is unchanged.
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
Fix validator-side PAT broadcast/check handling for transient GitHub
/userfailures.After #932, scoring uses
validate_github_credentials_result()so transient GitHub identity lookup failures can be distinguished from invalid PATs. The validator PAT handlers still used the legacy(github_id, error)wrapper, which droppedtransient_failure=Trueand treated temporary GitHub/userfailures as normal validation errors.Changes
validate_github_credentials_result()in PAT broadcast/check handlers.has_pat = Truepat_valid = Nonerejection_reason/userfailures in both broadcast and check flows.Testing
Targeted pyright on the changed files with local venv paths: 0 errors.
Note: full validator-suite runs in this sandbox hit pre-existing hangs in mirror/issue-discovery tests before reaching this change.
Related
Closes #1106