1 Commits
Author SHA1 Message Date
w3cjandClaude Opus 5.5 4baa6202cc fix(cursor): Cursor's agent stream passes, read message by message
CJ's M3 run with a real login: cursor-agent couldn't chat; it kept
reconnecting to agentn.global.api5.cursor.sh, and the VM's proxy logged
AgentService/Run as refused ("devvm couldn't read the login's token
request or reply"). The CLI's agent client compresses its requests
with gzip (connect-node's sendCompression, read from the 2026.11.11
package, for messages of 1 KiB and more), and a Connect server answers
a gzipped request with gzipped messages whatever the client accepts
(connect-go's negotiateCompression mirrors the request's; the spec has
the server assume the client takes the request's encoding). cursorReply
refused any reply with a Connect-Content-Encoding or Grpc-Encoding but
identity, so it refused Run's reply at its headers.

- frameScanner: a reply whose Content-Type is a Connect or gRPC stream
  passes message by message. Each is read whole, at most 16 MiB as it
  comes and as it decompresses, gunzipped when flagged compressed, and
  checked for a JWT's start before any of it passes, as it came.
  Connect's end of stream, and every message of a JSON stream, is also
  decoded and its strings checked, so escapes can't hide a token. An
  unknown flag, a compressed message without gzip or that isn't gzip,
  one over the limit, an envelope cut off, a token in the trailers, and
  gRPC-Web's base64 text end the stream before that message. Other
  replies keep jwtScanner; requests carry placeholders and pass as
  before.
- cursorReply takes gzip only as a stream's own message encoding, and
  refuses any other encoding as before.
- TestCursorStreams: a recorded-shape Run stream (gzipped messages, a
  plain one, an end of stream), which failed first ("an encoded reply");
  gRPC; each refusal; a token compressed, plain, at the end and escaped
  there; JSON streams. TestCursorReplyScans now uses a unary reply.
- e2e network: the fake company proxy's api2.cursor.sh answers Run as a
  Connect stream with gzipped messages, which passes whole through the
  VM's proxy, and one with a token, which ends before it.
- A focused threat review (security-audit skill): no way found for a
  token to reach the VM that the old refusal stopped; its memory and
  JSON-codec points are taken (no allocation from a declared length,
  JSON streams decoded, grpc-web-text refused). Base64 inside messages
  stays unread, as before, in internals' network page.

api3.cursor.sh, also blocked in that run, is the CLI's metrics host
(MetricsService, with a fixed key of the CLI's own, fire and forget),
which the allowlist leaves out on purpose; the CLI reaches it with
http2.connect, around HTTPS_PROXY, hence "without proxy settings".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 21:57:18 -07:00