Repository: openai/codex
File: codex-rs/protocol/src/protocol.rs (Rust)

Code before:
#[serde(rename_all = "snake_case")]
pub enum TurnAbortReason {
    Interrupted,
    Replaced,
    ReviewEnded,
}

#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "snake_case")]
pub enum CollabInteractionEvent {
    AgentSpawned {
        /// Thread ID of the sender.
        sender_id: ThreadId,
        /// Thread ID of the newly spawned agent.
        new_id: ThreadId,
        /// Initial prompt sent to the agent. Can be empty to prevent CoT leaking at the
        /// beginning.
        prompt: String,
    },
    AgentInteraction {
        /// Thread ID of the sender.
        sender_id: ThreadId,
        /// Thread ID of the receiver.
        receiver_id: ThreadId,
        /// Prompt sent from the sender to the receiver. Can be empty to prevent CoT
        /// leaking at the beginning.
        prompt: String,
    },
    WaitingBegin {
        /// Thread ID of the sender.
        sender_id: ThreadId,
        /// Thread ID of the receiver.
        receiver_id: ThreadId,
        /// ID of the waiting call.
        waiting_id: String,
    },
    WaitingEnd {
        /// Thread ID of the sender.
        sender_id: ThreadId,
        /// Thread ID of the receiver.
        receiver_id: ThreadId,
        /// ID of the waiting call.
        waiting_id: String,
        /// Final status of the receiver agent reported to the sender agent.
        status: AgentStatus,
    },
    Close {
        /// Thread ID of the sender.
        sender_id: ThreadId,
        /// Thread ID of the receiver.
        receiver_id: ThreadId,

Review comment (bug):
re: "Can be empty to prevent CoT leaking" - would this make debuggability harder? It feels like this shouldn't be empty because you want to know what the sender agent is doing, no? maybe a naive q because I don't know what's the risk of CoT leakage here

Code after:
}

/// Response payload for `Op::ListSkills`.
#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)]
pub struct ListSkillsResponseEvent {
    pub skills: Vec<SkillsListEntry>,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, JsonSchema, TS)]
#[serde(rename_all = "snake_case")]
#[ts(rename_all = "snake_case")]
pub enum SkillScope {
    User,
    Repo,
    System,
    Admin,
}

#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)]
pub struct SkillMetadata {
    pub name: String,
    pub description: String,
    #[ts(optional)]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub short_description: Option<String>,
    pub path: PathBuf,
    pub scope: SkillScope,
}

#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)]
pub struct SkillErrorInfo {
    pub path: PathBuf,
    pub message: String,
}

#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)]
pub struct SkillsListEntry {
    pub cwd: PathBuf,
    pub skills: Vec<SkillMetadata>,
    pub errors: Vec<SkillErrorInfo>,
}

#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)]
pub struct SessionConfiguredEvent {
    /// Name left as session_id instead of thread_id for backwards compatibility.
    pub session_id: ThreadId,

    /// Tell the client what model is being queried.
    pub model: String,

    pub model_provider_id: String,