Expand description
Codex CLI spawn + JSONL parsing helper shared by enrich and ingest --mode codex.
G31 (v1.0.69): enrich --mode codex was missing five critical hardening
flags compared to ingest --mode codex. This module extracts the
spawn pipeline into a single helper that BOTH call-sites consume,
guaranteeing the same defaults everywhere.
G32 (v1.0.69): enrich --mode codex used serde_json::from_str on the
raw stdout, but codex exec --json emits JSONL (one event per line).
parse_codex_jsonl iterates line-by-line, picking the last
item.completed of type agent_message as the assistant text.
G33 (v1.0.69): validate the model against the ChatGPT Pro OAuth whitelist
stored in ~/.codex/models_cache.json BEFORE spawning the subprocess.
Structs§
- Codex
Result - Combined result of one
codex execinvocation. - Codex
Spawn Args - Configuration for the codex spawner.
- Codex
Usage - Token usage reported by Codex on
turn.completedevents.
Constants§
- CODEX_
PRO_ OAUTH_ MODELS - Models accepted by Codex CLI when using ChatGPT Pro OAuth.
Functions§
- build_
codex_ command - Builds the
codex execcommand with the canonical hardening flags. - list_
codex_ models - Returns the list of models accepted by Codex with ChatGPT Pro OAuth.
- parse_
codex_ jsonl - Parses JSONL output from
codex exec --json. - parse_
extraction_ text - Parses the agent_message text as an
ExtractionResultJSON payload. - suggest_
codex_ model - Suggests the closest codex OAuth model to a user-supplied substring
(G33). Returns
Nonewhen no candidate is close enough. - trusted_
schema_ path - Computes a schema path under the cache dir so
codex execaccepts it as part of a trusted directory (rejects/tmpon hardened installs). - validate_
codex_ model - Validates the requested model against
CODEX_PRO_OAUTH_MODELS.