Repository navigation
Conversation
…e exchange race (AGT-4901) The callback handler returned without answering when the login timeout or a server error settled the flow during the token exchange, leaving the browser loading and the socket open. A shared endSupersededCallback now answers 410 with Connection: close exactly once. Applied to the OpenAI, Linear and OpenRouter PKCE flows, which had the same two returns.
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.
무엇
src/auth/pkceSettlement.ts에endSupersededCallback(res)를 추가했습니다. settlement를 잃은 콜백 응답을 410 +Connection: close+ 짧은 안내 HTML로 정확히 한 번 끝냅니다(이미 끝난 응답은 건드리지 않음).oauthPkce.ts의if (!settlement.finish()) return;두 곳(성공·실패 경로)을 이 헬퍼로 바꿨습니다. 같은 패턴이 있던linearPkce.ts,openrouterPkce.ts에도 똑같이 적용했습니다.OAuthFlowOptions.timeoutMs(기본 120초 유지)를 추가했습니다.왜
AGT-4901 (AGT-3443 잔여). 토큰 교환 도중 timeout·서버 오류가 먼저 settle하면, 이미 claim한 콜백의
res가 응답 없이 남아 브라우저가 계속 로딩하고 소켓이 열린 채로 있었습니다.검증
npx vitest run src/auth/→ 7 files, 59 tests 통과.oauthPkce.flow.test.ts: 실제 loopback 서버에 콜백을 보내고 fetch를 abort될 때까지 매달아 둔 상태에서 timeout이 이기면 410으로 응답이 끝나는지, 성공(200, accountId 파싱)·교환 실패(500) 경로가 각각 한 번 응답하는지 확인.npm run typecheck통과,oxlint src/auth/0 warnings.