Skip to main content

Module protocol

Module protocol 

Source
Expand description

App-server protocol types for the Codex CLI.

Every wire type is generated from the upstream JSON Schema bundle by scripts/codegen_protocol.py and lives in crate::protocol_generated::types. This module re-exports them and adds the JSON-RPC method-name constants the dispatch layer matches against.

§Parsing notifications

Prefer the typed dispatch in crate::messages over manual method checks:

use codex_codes::{Notification, ServerMessage};

fn handle(msg: ServerMessage) {
    if let ServerMessage::Notification(Notification::TurnCompleted(c)) = msg {
        println!("Turn on thread {} completed", c.thread_id);
    }
}

Re-exports§

pub use crate::protocol_generated::types::*;

Modules§

methods
JSON-RPC method names used by the app-server protocol.