Repository navigation
Conversation
Token-endpoint POSTs (refresh + authorization_code exchange) and the device authorization POST ran with no deadline. A wedged cloud endpoint hung the credential refresh under the manager's global semaphore, starving every other caller, or dead-ended login after the browser callback returned. Exchange calls now fail after 10s (the cloud HTTP family convention in this repo); refresh timeouts fall back to a fresh login via the existing orElseSucceed path, and the device-authorization POST maps to CloudCliAuthorizationError. AI-assisted: authored with AI assistance (Muse, Meta's Muse Spark) under the contributor's direction.
This was referenced Oct 16, 2026
This branch has not been deployed
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.
What Changed
OAuth token HTTP calls in
apps/server/src/cloud/CliTokenManager.tsnow have a 10s deadline (CLOUD_CLI_OAUTH_HTTP_TIMEOUT, matching the cloud HTTP family convention in this repo):exchangeToken(token-endpoint POST, used by the refresh flow and the loginauthorization_codeexchange)deviceAuthorizationEndpointPOST indeviceAuthorizationLogin(the poll loop was already bounded by the device-code lifetime)The device-authorization POST maps a timeout to
CloudCliAuthorizationError. Refresh timeouts fall back to a fresh login via the existingorElseSucceedpath inget.Why
Both calls ran with no deadline. A wedged cloud endpoint hung the credential refresh under the manager's global semaphore (starving every other
getcaller) or dead-endedloginafter the browser callback had already returned. Same defect family as the unboundedprotocol.tsrequest fixed in #4.Validation
CliTokenManager.test.tswith a never-respondingHttpClientmock underTestClock: stall during refresh fails withCloudCliCredentialRefreshError; stall at the device-authorization endpoint fails withCloudCliAuthorizationError. 10/10 tests green.vp fmt --checkclean;tsc --noEmitshows no new errors in the touched files (only a pre-existing style suggestion matching existing file idiom).Checklist
AI-assisted: authored with AI assistance (Muse, Meta's Muse Spark) under the contributor's direction.