mirror of
https://github.com/openai/codex.git
synced 2026-04-30 09:26:44 +00:00
[App-server] add new v2 events:item/reasoning/delta, item/agentMessage/delta & item/reasoning/summaryPartAdded (#6559)
core event to app server event mapping: 1. `codex/event/reasoning_content_delta` -> `item/reasoning/summaryTextDelta`. 2. `codex/event/reasoning_raw_content_delta` -> `item/reasoning/textDelta` 3. `codex/event/agent_message_content_delta` → `item/agentMessage/delta`. 4. `codex/event/agent_reasoning_section_break` -> `item/reasoning/summaryPartAdded`. Also added a change in core to pass down content index, summary index and item id from events. Tested with the `git checkout owen/app_server_test_client && cargo run -p codex-app-server-test-client -- send-message-v2 "hello"` and verified that new events are emitted correctly.
This commit is contained in:
@@ -617,6 +617,9 @@ pub struct ReasoningContentDeltaEvent {
|
||||
pub turn_id: String,
|
||||
pub item_id: String,
|
||||
pub delta: String,
|
||||
// load with default value so it's backward compatible with the old format.
|
||||
#[serde(default)]
|
||||
pub summary_index: i64,
|
||||
}
|
||||
|
||||
impl HasLegacyEvent for ReasoningContentDeltaEvent {
|
||||
@@ -633,6 +636,9 @@ pub struct ReasoningRawContentDeltaEvent {
|
||||
pub turn_id: String,
|
||||
pub item_id: String,
|
||||
pub delta: String,
|
||||
// load with default value so it's backward compatible with the old format.
|
||||
#[serde(default)]
|
||||
pub content_index: i64,
|
||||
}
|
||||
|
||||
impl HasLegacyEvent for ReasoningRawContentDeltaEvent {
|
||||
@@ -923,7 +929,13 @@ pub struct AgentReasoningRawContentDeltaEvent {
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)]
|
||||
pub struct AgentReasoningSectionBreakEvent {}
|
||||
pub struct AgentReasoningSectionBreakEvent {
|
||||
// load with default value so it's backward compatible with the old format.
|
||||
#[serde(default)]
|
||||
pub item_id: String,
|
||||
#[serde(default)]
|
||||
pub summary_index: i64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)]
|
||||
pub struct AgentReasoningDeltaEvent {
|
||||
|
||||
Reference in New Issue
Block a user