Skip to content

fix(T707): agentmbx login backs off on 429/503 instead of aborting - #379

Open
kryptobaseddev wants to merge 1 commit into
mainfrom
fix/t707-login-429-backoff
Open

kryptobaseddev wants to merge 1 commit into
mainfrom
fix/t707-login-429-backoff

Conversation

@kryptobaseddev

Copy link
Copy Markdown
Owner

Grok feea28a. The staging device-token endpoint answered 429, and agentmbx login printed "unexpected token response" and quit, losing the owner's approval.

429 and 503 are now treated like slow_down. The client waits Retry-After or X-Retry-After when the value is a positive number of seconds that fits the code's remaining life; otherwise it waits interval+5, and it adds 5 to later polls. A wait that would outlive the code stops with the expiry message. Other non-OAuth answers still stop, and the token is never logged. LoginPostResult gains an optional retryAfter (capped at 64 chars).

test/login.test.ts 12 pass (429 with and without a header, an absurd header, expiry during backoff), tsc 0, check-dist 0, project-mailbox ratchet ok. CHANGELOG Unreleased only.

🤖 Generated with Claude Code

A 429 or 503 from the device token poll is not an OAuth error. Wait a sane Retry-After or X-Retry-After, otherwise the interval plus 5 seconds, and keep polling until the code expires.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant