Skip to main content

Module project

Module project 

Source
Expand description

CodexProjector — maps a ConversationView back to a Codex crate::Session.

This is the inverse of crate::provider::to_view: where to_view reads a Codex rollout JSONL into a provider-agnostic view, CodexProjector serializes that view back into the on-disk shape (a sequence of RolloutLines starting with a session_meta line, followed by a turn_context, then per-turn response_item and event_msg lines).

The projector consumes provider-specific data the forward path stashed under Turn.extra["codex"]:

  • reasoning_encrypted: opaque ciphertext blobs that round-trip verbatim as Reasoning::encrypted_content
  • tool_extras: per-call_id extras (exec exit_codes, custom-call statuses, patch-change manifests, etc.) preserved on the matching function_call_output / custom_tool_call_output line

For non-Codex sources, the projector synthesizes sensible defaults (originator: "codex-toolpath", source: "cli", model_provider: "openai").

Foreign-namespace extras (Turn.extra["claude"], Turn.extra["gemini"], …) are dropped — they have no meaning in Codex’s protocol and would pollute the JSONL.

Structs§

CodexProjector
Project a ConversationView into a Codex crate::types::Session.