feat: add xAI OAuth manual-code login fallback#27556
Closed
WinterArc21 wants to merge 1 commit into
Closed
Conversation
Collaborator
1 task
Contributor
|
Closing in favor of #26929 (submitted first, same gap). #26929 already provides |
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
--manual-code/--paste-codefor xAI Grok OAuth so remote, phone, Discord, SSH, and headless sessions can complete login without a live loopback callback.statewhen a full redirect URL/query string is pasted, and sharing token exchange validation with the loopback flow.hermes login,hermes auth add, andhermes model.Why
The existing xAI OAuth flow starts a localhost callback listener on the Hermes machine. That works when the browser is also on that machine, but it breaks when Hermes is being driven from Discord, a phone, SSH, WSL, or another remote setup. In those cases, xAI redirects the browser to
127.0.0.1on the browser device, not the machine running Hermes.Manual-code mode keeps the existing xAI PKCE flow, but gives the user a way to paste the authorization response back into Hermes when the browser cannot reach the local listener.
Test plan
python -m py_compile hermes_cli/auth.py hermes_cli/auth_commands.py hermes_cli/main.pypython -m pytest tests/hermes_cli/test_auth_xai_oauth_provider.py tests/hermes_cli/test_auth_commands.py tests/hermes_cli/test_auth_loopback_ssh_hint.py tests/hermes_cli/test_argparse_flag_propagation.py -o 'addopts=' -qpython -m pytest tests/hermes_cli/test_auth*.py tests/hermes_cli/test_argparse_flag_propagation.py -o 'addopts=' -qgit diff --check