Compare commits

...

1 Commits

Author SHA1 Message Date
pakrym-oai
7dca27ef38 exec_events: rename SessionCreatedEvent to CollaborationStartedEvent and update event name
- Changed ConversationEvent variant from SessionCreated to CollaborationStarted and updated serde rename from "session.created" to "collaboration.started"
- Renamed SessionCreatedEvent struct to CollaborationStartedEvent throughout codebase and tests
- Updated event processor and tests to use new variant and struct
2025-09-29 13:25:36 -07:00
3 changed files with 15 additions and 11 deletions

View File

@@ -6,8 +6,8 @@ use ts_rs::TS;
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, TS)]
#[serde(tag = "type")]
pub enum ConversationEvent {
#[serde(rename = "session.created")]
SessionCreated(SessionCreatedEvent),
#[serde(rename = "collaboration.started")]
CollaborationStarted(CollaborationStartedEvent),
#[serde(rename = "turn.started")]
TurnStarted(TurnStartedEvent),
#[serde(rename = "turn.completed")]
@@ -23,7 +23,7 @@ pub enum ConversationEvent {
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, TS)]
pub struct SessionCreatedEvent {
pub struct CollaborationStartedEvent {
pub session_id: String,
}

View File

@@ -6,6 +6,7 @@ use crate::event_processor::CodexStatus;
use crate::event_processor::EventProcessor;
use crate::event_processor::handle_last_message;
use crate::exec_events::AssistantMessageItem;
use crate::exec_events::CollaborationStartedEvent;
use crate::exec_events::CommandExecutionItem;
use crate::exec_events::CommandExecutionStatus;
use crate::exec_events::ConversationErrorEvent;
@@ -20,7 +21,6 @@ use crate::exec_events::ItemUpdatedEvent;
use crate::exec_events::PatchApplyStatus;
use crate::exec_events::PatchChangeKind;
use crate::exec_events::ReasoningItem;
use crate::exec_events::SessionCreatedEvent;
use crate::exec_events::TodoItem;
use crate::exec_events::TodoListItem;
use crate::exec_events::TurnCompletedEvent;
@@ -119,9 +119,11 @@ impl ExperimentalEventProcessorWithJsonOutput {
&self,
payload: &SessionConfiguredEvent,
) -> Vec<ConversationEvent> {
vec![ConversationEvent::SessionCreated(SessionCreatedEvent {
session_id: payload.session_id.to_string(),
})]
vec![ConversationEvent::CollaborationStarted(
CollaborationStartedEvent {
session_id: payload.session_id.to_string(),
},
)]
}
fn handle_agent_message(&self, payload: &AgentMessageEvent) -> Vec<ConversationEvent> {

View File

@@ -9,6 +9,7 @@ use codex_core::protocol::PatchApplyBeginEvent;
use codex_core::protocol::PatchApplyEndEvent;
use codex_core::protocol::SessionConfiguredEvent;
use codex_exec::exec_events::AssistantMessageItem;
use codex_exec::exec_events::CollaborationStartedEvent;
use codex_exec::exec_events::CommandExecutionItem;
use codex_exec::exec_events::CommandExecutionStatus;
use codex_exec::exec_events::ConversationErrorEvent;
@@ -21,7 +22,6 @@ use codex_exec::exec_events::ItemUpdatedEvent;
use codex_exec::exec_events::PatchApplyStatus;
use codex_exec::exec_events::PatchChangeKind;
use codex_exec::exec_events::ReasoningItem;
use codex_exec::exec_events::SessionCreatedEvent;
use codex_exec::exec_events::TodoItem as ExecTodoItem;
use codex_exec::exec_events::TodoListItem as ExecTodoListItem;
use codex_exec::exec_events::TurnCompletedEvent;
@@ -62,9 +62,11 @@ fn session_configured_produces_session_created_event() {
let out = ep.collect_conversation_events(&ev);
assert_eq!(
out,
vec![ConversationEvent::SessionCreated(SessionCreatedEvent {
session_id: "67e55044-10b1-426f-9247-bb680e5fe0c8".to_string(),
})]
vec![ConversationEvent::CollaborationStarted(
CollaborationStartedEvent {
session_id: "67e55044-10b1-426f-9247-bb680e5fe0c8".to_string(),
}
)]
);
}