[codex] Fix OAuth wait cancellation in /login#1906
Draft
digging-airfare-4u wants to merge 1 commit intoMoonshotAI:mainfrom
Draft
[codex] Fix OAuth wait cancellation in /login#1906digging-airfare-4u wants to merge 1 commit intoMoonshotAI:mainfrom
digging-airfare-4u wants to merge 1 commit intoMoonshotAI:mainfrom
Conversation
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
Fixes #1905.
This change makes the Kimi Code OAuth device login flow cancellable while the shell UI is waiting for browser authorization.
What changed
/loginflow into the OAuth login routineEsc,Ctrl+C, andCtrl+Dcan cancel the waiting stateEscwhile waiting for browser authorization cancels the current login attempt and returns to the shell prompt, rather than navigating back to platform selectionRoot cause
The device authorization loop only polled and slept, with no cancel signal. The shell-level
/loginflow also did not hook the waiting state into the existing running-prompt cancel handling.Validation
uv run pytest tests/auth/test_oauth_login.py tests/ui_and_conv/test_shell_oauth.py tests/ui_and_conv/test_shell_prompt_router.pyuv run ruff check src/kimi_cli/auth/oauth.py src/kimi_cli/ui/shell/oauth.py tests/auth/test_oauth_login.py tests/ui_and_conv/test_shell_oauth.py