fix: prevent callback shutdown from blocking login - #265
Conversation
Force-close temporary callback connections after the response finishes and continue token exchange without awaiting listener teardown. Add keep-alive and orchestration regression coverage for proxied sandbox logins.
Resolve valid callbacks when the response closes before finish, and keep timeout and callback-error reporting independent from listener teardown. Remove the test-only callback port field and strengthen shutdown ordering coverage.
|
Addressed the Fable review in b31d724:
I retained the Biome schema alignment and non-null cleanup, and called them out explicitly in the PR body because reverting them restores current lint diagnostics. Final deterministic validation passes. The live authenticated backend was unhealthy during rerun (MCP 60s timeout; CLI request stalled beyond five minutes); this is recorded in the PR body. |
Retry the probe-and-rebind test setup on EADDRINUSE and limit the response prototype spy to the request window it must control.
|
Addressed both round-2 test findings in 84ef745:
Validation: 2579 tests pass, focused socket regressions pass 40/40, formatting/lint/types pass, build passes, and generated plugin assets validate. |
|
Live smoke rerun passed on the host after respecting the backend rate-limit cooldown:
The PR validation section has been updated to replace the earlier backend-timeout/rate-limit note. |
Summary
Root cause
The login flow awaited HTTP server close before exchanging the authorization code. A sandbox port proxy could keep the callback connection alive after rendering the success page, leaving init blocked indefinitely. The callback result also depended only on the response finish event, so an early connection close could leave a valid callback unsettled.
Review follow-up
The Biome schema alignment and removal of a forbidden non-null assertion are validation-only cleanup surfaced by this change; they do not affect callback behavior.
Validation