Commit Graph
4 Commits
Author SHA1 Message Date
Benjamin Carlsson 7ee5efad4a Add typed item lifecycle events to the cloud client (#59066)
## What changed

Decode live item start and completion notifications as `TranscriptUpdate::ItemStarted` and `TranscriptUpdate::ItemCompleted`, with turn identity, lifecycle timestamps, and summaries for user messages, agent messages, reasoning, commands, and file changes.

Preserve structured agent questions even when message text is empty, optional command output and exit details, and command or patch status independently of lifecycle completion. Keep unsupported or incomplete items as opaque notifications and redact summary fields in debug output.

## Testing

Add fixtures covering lifecycle ordering alongside deltas, identity and timestamps, status and optional-field preservation, structured questions, opaque fallback, malformed payloads, thread ownership, and debug redaction.

GitOrigin-RevId: d6bf2d25ee85be17d895726c5072850a9851b55f
2026-11-03 05:43:27 +00:00
Benjamin Carlsson fbf5f0d3a7 Decode live transcript updates in the cloud client (#59047)
## Why

Attach notifications previously exposed only opaque protobuf bytes. Typed transcript events let callers access live text, command output, file changes, and turn state directly.

## What changed

- Add `Event::Transcript` with typed agent-message, command-output, and file-change deltas; patch updates; and turn start/completion events.
- Expose patch kinds and move paths, turn status and failure details, and server-provided timestamps and duration.
- Validate transcript thread IDs. Preserve unsupported or incomplete notifications and other threads' turn lifecycle events as opaque payloads; reject deltas for another thread.
- Keep transcript payloads redacted in `Debug` output.

## Testing

Add independent protobuf fixtures covering Attach decoding, opaque fallback and stream continuation, patch ordering, turn timing and failures, thread validation, repeated oneof variants, unknown fields, and debug redaction.

GitOrigin-RevId: f26b8d4a5b355bb12159136e83310cb57c1546ca
2026-11-03 02:49:40 +00:00
cooper-oai cf29971d93 Integrate runtime authentication into model requests (#57171)
## What changed

- Add opt-in runtime authentication through `ModelClient::with_runtime_auth`, requiring the provider and runtime manager to share the selected OpenAI credentials.
- Keep runtime identity, credentials, routing, and transport selection consistent for each request and its retries, signing a fresh assertion for each attempt.
- Apply authentication asynchronously to WebSocket handshakes, replace stale authentication headers, and reconnect when the runtime changes.
- Reject account, organization, or project selectors that conflict with the registered runtime, and preserve gateway OAuth composition.

## Testing

Add coverage for dual-header and assertion-only authentication, HTTP retries, runtime replacement and account switches, stale WebSocket headers, selector mismatches, gateway OAuth failures, transport revocation, and Realtime compatibility.

GitOrigin-RevId: 45b9efc2c80481406a0f6f6396a8cdd21d933c12
2026-10-26 18:06:07 +00:00
Benjamin Carlsson b707714ae4 Add a native gRPC client for cloud thread resume and attach (#50113)
## What changed

Add `codex-cloud-client`, a reusable Rust client for `ThreadService.Resume` and live `ThreadService.Attach` over HTTP/2. Callers supply the native gRPC origin, bearer token, account ID, and `HttpClientFactory`.

- Reuse shared proxy, custom CA, and network policy handling for HTTPS. Reject redirects and allow plaintext HTTP only on direct loopback with unrestricted, unmanaged policy.
- Preserve notification and server-request protobuf payloads as opaque bytes and expose native gRPC status details while redacting credentials, payloads, and error details from diagnostics.
- Bound resume and attach setup to 150 seconds without retrying requests or imposing an idle deadline on live streams. Attach ends on its first error and provides no history or automatic reconnect.
- Select Rustls in `HttpClientBuilder::http2_prior_knowledge()` so HTTPS advertises `h2` through ALPN.

Include a standalone attach example and documentation of admission semantics and stream behavior.

## Testing

Add HTTP/2 fixture tests for protobuf framing, authentication metadata, status trailers, event preservation, malformed responses, stream cancellation, redirect rejection, and diagnostic redaction. Add checks for unsafe origins, network policy restrictions, and TLS `h2` advertisement.

GitOrigin-RevId: 55db70438bb5e59272c6995c67a46ced5fa28ff4
2026-10-01 22:32:29 +00:00