Add attachment upload and resolution APIs and pass stores into sessions (#45556)

## What changed

Replace `AttachmentStore::persist` with `upload` and `resolve`. Uploads return inline bytes or a file ID; resolution returns optional file metadata and a download URL only when a minimum URL lifetime is requested. Add image dimensions, digest, size, MIME type, and categorized errors to the API.

Make `InlineAttachmentStore` return the original bytes and report `NotFound` when resolving file IDs. Redact attachment bytes and file URLs in debug output.

Pass the configured image store from the thread manager into sessions and inherit it in delegated sessions. Allow `TestCodexBuilder` to accept a custom image store.

## Testing

Update unit coverage for preserving PNG and JPEG bytes, redacting bytes and URLs in debug output, and rejecting file resolution in the inline store.

GitOrigin-RevId: f313e0048925998d84394c7e5a278e0d39d86a45
This commit is contained in:
Krish Chainani authored and copyberry committed 2026-09-15 00:29:13 +00:00
1 parent 364b511dcd
commit 446b771049
13 files changed
+247 -89

No files matched your search

+1
View File
@@ -127,6 +127,7 @@ pub(crate) async fn run_codex_thread_interactive(
client_mcp_extensions: parent_session.services.client_mcp_extensions.clone(),
reserved_thread_id: None,
analytics_events_client: Some(parent_session.services.analytics_events_client.clone()),
image_store: Arc::clone(&parent_session.services.image_store),
thread_store: Arc::clone(&parent_session.services.thread_store),
attestation_provider: parent_session.services.attestation_provider.clone(),
external_time_provider: Some(Arc::clone(&parent_session.services.time_provider)),