## What changed
- Make `codex tcp-tunnel` an SSH stdio helper, removing the loopback listener, stdin control protocol, and JSON diagnostics.
- Add `--token-file` for one-use credentials, consumed only after gateway verification, with environment-based OAuth routing or a legacy IPv4 `--target`.
- Honor system HTTPS proxy settings without attempting direct QUIC, and keep gateway credentials inside verified TLS.
- Race direct TCP addresses through TLS and HTTP/2 readiness so stalled peers do not block a working address.
## Testing
Add coverage for proxy credential isolation and stalled TLS peers, plus an opt-in Linux OpenSSH integration test for complete uploads and remote exit while local stdin remains open.
GitOrigin-RevId: 62423c8a8267842c9e401b3f9094c7278c47a490
## Why
SSH tunnels need a working transport when UDP is blocked or a QUIC connection cannot complete an HTTP/3 CONNECT request.
## What changed
- Race TLS HTTP/2 CONNECT against HTTP/3 after a 250 ms QUIC head start, selecting the first successful CONNECT response.
- Verify the gateway before obtaining credentials, treat CONNECT rejection as terminal, and include admission in the setup timeout.
- Preserve bounded buffering, TCP half-close behavior, and SSH exit on remote EOF over HTTP/2. Keep peer-supplied debug text out of SSH errors.
## Testing
Add local TLS HTTP/2 and HTTP/3 peer tests for transport selection, blocked UDP, stalled HTTP/3, terminal rejection, setup deadlines, certificate verification, address retries, and bidirectional forwarding with both half-close orders.
GitOrigin-RevId: a1cde88dff7a4e5e6574cf12eacb453551f01b72
## What changed
Require `x-portals-auth-mode: oauth` in CONNECT metadata when the TCP tunnel listener connects to a known Portals gateway. Reject missing or non-OAuth metadata before reading credentials.
Remove local tunnel JWT type and version checks and treat tokens as opaque bearer credentials. Drop the unused `base64` dependency from `codex-tcp-tunnel`.
## Testing
Replace JWT validation tests with coverage that rejects missing OAuth metadata and accepts OAuth metadata with an opaque access token.
GitOrigin-RevId: 746816f0227280524c019dd90df203b182934751
## What changed
Allow ERS-issued tunnel JWTs with numeric `ver` values of `1` or `2` at startup and during credential renewal. Update the validation error to reflect both supported versions.
## Testing
Add coverage for all v1/v2 startup and renewal combinations, bearer modes accepting both versions, and rejection of unsupported versions, malformed claims, missing or empty signatures, and extra JWT segments.
GitOrigin-RevId: 597089de7cf9511d29095d87f36251eb7319f631
## Why
The existing loopback listener mode does not provide the stdin/stdout transport needed by OpenSSH's `ProxyCommand`.
## What changed
- Relay one SSH session over HTTP/3 CONNECT with `--environment-id ENV --port PORT`, defaulting to the public Portals gateway and port 22. Also accept an explicit `--proxy-url` with `--target ENV:PORT`.
- Require ChatGPT OAuth login, enforce cloud configuration and application network policy, and restrict OAuth credentials to the built-in gateway origin. Leave SSH authentication and host-key verification to OpenSSH.
- Preserve binary stdio, propagate input half-close, exit on gateway EOF, and report rejected CONNECT requests by HTTP status without exposing arbitrary peer error text.
- Require ERS-issued v2 tunnel JWTs for Portals listener mode unless OAuth mode is selected, and reject older ERS tunnel JWTs during credential updates.
- Disable UDP segmentation offload for SSH tunnels on Linux to avoid stalled bulk transfers on affected paths. Document an OpenSSH configuration example.
## Testing
Add coverage for argument validation, gateway routing, credential boundaries, JWT startup and renewal checks, binary relay and half-close behavior, gateway EOF and rejection, and cloud policy enforcement before gateway connection.
GitOrigin-RevId: 0d9afbddef01748efcc1c4b88f7e19923deff7e1
## Why
QPACK can expand compact response headers into large decoded field sections. Bound their size before `h3` constructs its capacity-limited `HeaderMap`.
## What changed
Set the HTTP/3 client's maximum field section size to 64 KiB so oversized responses are rejected with `HeaderTooBig`.
## Testing
Add a regression test that sends QPACK static references around the size limit and a much larger expansion. Verify that oversized responses are rejected and a subsequent valid response succeeds on the same connection.
GitOrigin-RevId: d7c83a7a755dfafae05919ec52542ffce40a1ef4
## What changed
Add `codex tcp-tunnel --diagnostics-json` to emit versioned, newline-delimited JSON diagnostics on stderr. Records classify startup, CONNECT, transport, and control failures without exposing credentials, addresses, headers, or raw error messages. Rejected CONNECT records may include a validated `http_status`.
Distinguish terminal failures from recoverable stream and transport events, flush terminal records before returning a generic error, and preserve stdout readiness and credential acknowledgments. Keep human-readable diagnostics as the default and document the version 1 schema and consumer fallback rules.
## Testing
Add tests for bounded output, error-chain suppression, terminal flushing, control error classification, CONNECT status validation, legacy behavior, and flag parsing. Extend the reconnect test to exercise a rejected CONNECT followed by a successful connection in JSON mode.
GitOrigin-RevId: 350f67fe8e3f313e8a6d3bb0fd891952b77647fd
## What changed
Add `codex tcp-tunnel` and the `codex-tcp-tunnel` crate to forward loopback TCP connections to an explicit target through a TLS-verified HTTP/3 CONNECT proxy.
- Require the proxy origin to match an approved HTTPS origin in a supplied policy file.
- Read bearer tokens and optional bounded, non-forwarding `x-` headers from stdin. Support token updates for new connections, `LISTENING` and `AUTH_UPDATED` notifications, and shutdown when the control pipe closes in token-update mode.
- Preserve the listener across proxy reconnects without replaying TCP streams, and let accepted streams continue while a proxy drains.
## Testing
Add tests for hidden CLI parsing, proxy and target validation, credential renewal, control-pipe closure, and invalid input without secret disclosure. A local HTTP/3 proxy test covers token replacement, transport recovery without stream replay, and graceful draining.
GitOrigin-RevId: c6af3025301c61e9fe90940cf5a6df0039465e69