codex exec process for each incoming message and tracks conversation continuity through a Codex thread ID.
Configuration
Codex-specific options
| Variable | Default | Description |
|---|---|---|
CODEX_USE_OSS | false | Pass --oss to codex exec, enabling open-source model support. |
CODEX_LOCAL_PROVIDER | (empty) | Pass --local-provider <name> to codex exec when using a local inference backend. |
CODEX_FULL_AUTO | true | Pass --full-auto to codex exec so Codex can take actions without asking for confirmation. |
How session management works
Codex tracks conversations through thread IDs rather than persistent subprocesses:First message
The gateway runs
codex exec <prompt> with the full system prompt and user message. Codex returns a thread ID in the thread.started event.Thread ID is persisted
The gateway saves the thread ID to
codex-thread-id.txt in the session directory. This file survives restarts.Subsequent messages
For every following message in the same conversation, the gateway runs
codex exec resume <thread-id> <prompt>, allowing Codex to continue from where it left off.Recall-first memory behavior
Codex does not have Pi-style tool hooks, so the gateway embeds the Nuggets memory workflow directly into the system prompt that is prepended to every message:nuggets command-line interface through its shell tools, giving it effective access to FHRR fact recall and storage even without native tool hooks.
Skills
Skills catalog
When you have skills installed, the Codex system prompt includes a structured XML catalog of all available skills:SKILL.md file for any skill it determines is relevant using its normal file tools. This means Codex only reads skill content on demand rather than loading every skill upfront.
Active skill inlining
For skills that are already active in the session (triggered by message text or activated with/skill use), the full instructions are inlined directly into the prompt under an “Active project skills” heading. Skills with adapters.codex.enabled set to false in their skill.json are excluded from both the catalog and inline sections.
Scheduling
Codex handles scheduling by writing a JSON line to.gateway/cron/requests.jsonl. The system prompt instructs Codex to use the following format:
Codex scheduling depends on the agent having write access to the
.gateway/cron/ directory. With CODEX_FULL_AUTO=true, Codex handles this automatically without prompting for confirmation.