Skip to content

Keep HTTP/2 when takeover relays Cursor streaming calls - #493

Open
donalffons wants to merge 1 commit into
leookun:mainfrom
donalffons:fix/preserve-http2-bidi
Open

donalffons wants to merge 1 commit into
leookun:mainfrom
donalffons:fix/preserve-http2-bidi

Conversation

@donalffons

Copy link
Copy Markdown

Summary

  • Cursor speech-to-text (and the network diagnostic's Agent check) uses a bidirectional HTTP/2 Connect stream. With takeover enabled, that check waits 60s and dictation records a waveform but never inserts text. With takeover disabled, the same Agent check succeeds.
  • Stock hudsucker 0.25 rewrites every proxied request to HTTP/1.1 in normalize_request. HTTP/1.1 cannot carry that stream: the upstream does not send the first response until the request body ends, and the client will not end the body until the first response arrives.
  • Vendor hudsucker 0.25.0 and keep HTTP/2 for HTTPS upstreams. Plaintext HTTP (the local backend) still downgrades to HTTP/1.1, so locally handled agent routes are unchanged.

Test plan

  • cargo test --manifest-path third_party/hudsucker/Cargo.toml --lib proxy::internal::tests::normalize_request (preserves HTTP/2 for https, downgrades plaintext http)
  • Quit the running Cursor BYOK app, start this build, enable takeover, then rerun Cursor's network diagnostic. Agent should pass.
  • Dictate a sentence into Cursor's chat input and confirm the transcript appears.
  • Send a normal agent message with takeover on and confirm model routing still works.

Cursor's HTTP/2 agent transport (agent runs, voice input) ignores
http.proxy, so forcing HTTP/1.1 broke speech-to-text. While takeover
runs, server config now points agentn at a local TLS listener signed by
the takeover CA. Runs for configured models are served locally; all
other calls are relayed to agentn.api5.cursor.sh over HTTP/2.

Turning takeover off stops the listener and restarts Cursor so it drops
the cached agent URL. Other HTTP clients stay HTTP/1.1-only.
@donalffons
donalffons force-pushed the fix/preserve-http2-bidi branch from d9527cc to 3d13517 Compare October 1, 2026 10:35
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.

1 participant