fix: handle slow_down in GitHub device-flow token polling#1344
fix: handle slow_down in GitHub device-flow token polling#1344friendlygeorge wants to merge 1 commit into
Conversation
Per RFC 8628 §3.5, slow_down is not a terminal error. The client must increase its polling interval by 5 seconds and continue. Previously, slow_down was treated as a fatal error, causing login to fail with "token request failed: slow_down" and forcing the user to restart. This commit treats slow_down the same as authorization_pending but with the required interval increase.
|
Hi! This PR has been open for 5 days. Just checking if there's anything I can do to help move it forward — happy to address any review feedback or make adjustments. The fix handles the |
|
Hi — just a gentle ping. CI is green (Build/Lint + Tests passing). This fixes #1289 — the fatal error that kills device-flow login sessions. Happy to make any adjustments if the approach needs tweaking. |
|
Hi — gentle ping. CI is green (Build/Lint + Tests passing). This treats slow_down as retriable per RFC 8628 §3.5 — prevents unrecoverable login failures when GitHub rate-limits device-flow polling. Happy to iterate if needed. |
|
Hi — gentle ping. CI is green (Build/Lint + Tests passing). Per RFC 8628 section 3.5, slow_down should be treated as retriable in device-flow polling — currently it causes an unrecoverable fatal error. Happy to iterate if the implementation needs changes. |
Summary
Treat
slow_downas a retriable error in the GitHub device-flow token polling loop, per RFC 8628 §3.5.Problem
When GitHub's device-flow token endpoint returns
slow_down, the publisher exits with a fatal error:The login session is unrecoverable — the user must re-run the command and hope to authorize before any
slow_downis emitted again.Root Cause
In
pollForToken, onlyauthorization_pendingis treated as retriable.slow_downfalls into the catch-all error branch and aborts:Fix
Treat
slow_downthe same asauthorization_pendingbut with the required interval increase (+5 seconds):Testing
The existing test infrastructure doesn't directly test
pollForToken(unexported method, external test package). The fix is minimal (4 lines changed) and follows the exact pattern specified in RFC 8628 §3.5. Can verify manually:mcp-publisher login githubRelated
slow_downas fatal instead of backing off #1289