Skip to content

fix(cursor): release discarded OAuth poll responses - #573

Open
ooiuuii wants to merge 1 commit into
openpi-dev:mainfrom
ooiuuii:fix/cursor-poll-response-cleanup
Open

ooiuuii wants to merge 1 commit into
openpi-dev:mainfrom
ooiuuii:fix/cursor-poll-response-cleanup

Conversation

@ooiuuii

@ooiuuii ooiuuii commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Problem

Fixes #571.

The Cursor browser-auth poller leaves non-2xx response bodies unread. Pending 404 responses and error responses can retain pooled connection resources and delay the next poll.

Value

Keep a waiting browser login from unnecessarily blocking its own subsequent requests in a constrained connection pool.

Approach

Cancel discarded response bodies before the existing status handling. Ignore cleanup rejection so it cannot replace the established pending/error semantics. The same cleanup idiom already exists in the usage provider utilities.

Only four production lines are added. Retry count, backoff, request/login deadlines and credentials remain unchanged. The existing request timeout bounds retention; this is not a claim of permanent leakage or universal login failure.

Validation

  • Real loopback HTTP fixture + single-connection Undici pool: unchanged poller blocks before request two; fixed poller reaches the synthetic success response. No real provider/account data.
  • Exact final tests against unchanged production: 2 fail / 1 pass; fixed 3/3 pass, including error cleanup and cleanup-rejection behavior.
  • Complete provider Node tests: 88/88 pass.
  • Bun mock-body cases: 2/2 pass. The actual pool fixture uses the repository's Node runner; Bun's Undici shim lacks Pool.destroy, so a full bun test run of this file is not claimed.
  • bun run check, git diff --check, one scoped read-only review — pass/no actionable findings.
  • Full local suite not claimed green because this Windows host has reproduced baseline timing failures and a background-terminal cleanup hang. GitHub CI will provide fresh branch-specific full-suite results.

Impact

  • User-visible: avoid unnecessary connection-pool stalls during Cursor login.
  • Model/tools: none.
  • Runtime/lifecycle: discarded HTTP body resources are released earlier.
  • Persisted config/data: none.
  • Compatibility/risk: no authentication protocol, retry policy, timeout, or successful token parsing changes.

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.

bug(cursor): discarded OAuth poll responses can block the next request

1 participant