Conversation
The project approval loop resolved the gateway URL once before the loop, so a failed GET /v1/gateway-url rejected start(), which configureManualApproval swallows. Polling never started and approvals were never delivered. Resolve inside the loop, like OrgApprovalClient, so it backs off and retries.
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 is the current behavior?
ApprovalClient.start()resolves the gateway URL once, before the poll loop:When
ONECLI_GATEWAY_URLisn't set andGET /v1/gateway-urlfails (OneCLI not up yet, a 5xx, a network error),start()rejects.configureManualApprovalcatches that rejection and drops it, so polling never starts. The handle looks normal, nothing is logged, and no approval reaches the callback until the process restarts. Held requests just wait until they time out.The comment in
configureManualApprovalsays "Errors handled internally with backoff", and that's already true for poll failures.OrgApprovalClient.start()also resolves inside its loop for this reason.What is the new behavior?
The resolution moves inside the
tryin the loop, the same wayOrgApprovalClientdoes it. A failed resolution now takes the existing 5s backoff and is retried.resolveGatewayUrlstill caches on success, so once it resolves, each poll does no extra work.Additional context
test/approvals/client.test.tsgoes throughOneCLI.configureManualApproval. The first/v1/gateway-urlcall returns 503, the second returns the gateway URL, and the first poll returns one pending request. The test checks that resolution is retried after the backoff and that the callback receives the request.Checked locally on Node 22 with pnpm 10.30.1:
main(6579233)expected 1 to be 2(no retry, callback never called)pnpm testpnpm typecheckpnpm buildNot tested against a running OneCLI instance.