Add a wrapper around raw response items (#5923)

We currently have nested enums when sending raw response items in the
app-server protocol. This makes downstream schemas confusing because we
need to embed `type`-discriminated enums within each other.

This PR adds a small wrapper around the response item so we can keep the
schemas separate
This commit is contained in:
Rasmus Rygaard
2025-10-29 13:32:40 -07:00
committed by GitHub
parent 069a38a06c
commit 39e09c289d
3 changed files with 16 additions and 4 deletions

View File

@@ -16,6 +16,7 @@ use codex_app_server_protocol::SendUserMessageResponse;
use codex_protocol::ConversationId;
use codex_protocol::models::ContentItem;
use codex_protocol::models::ResponseItem;
use codex_protocol::protocol::RawResponseItemEvent;
use pretty_assertions::assert_eq;
use std::path::Path;
use tempfile::TempDir;
@@ -294,7 +295,9 @@ async fn read_raw_response_item(
.cloned()
.expect("raw response item should include msg payload");
serde_json::from_value(msg_value).expect("deserialize raw response item")
let event: RawResponseItemEvent =
serde_json::from_value(msg_value).expect("deserialize raw response item");
event.item
}
fn assert_instructions_message(item: &ResponseItem) {