codex-worker
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| CODEX_BIN | No | Optional explicit path to the codex executable (auto-discovered by default). | |
| CODEX_DEFAULT_MODEL | No | Default Codex model slug. | gpt-6.2-sol |
| CODEX_LANE_IDLE_MINUTES | No | Idle expiration window for cached workspace lanes. | 45 |
| CODEX_AUTO_ROTATE_TOKENS | No | Soft context token threshold before rotating a hot lane to a fresh thread. | 175000 |
| CODEX_DEFAULT_MAX_COMMANDS | No | Default per-job shell command ceiling. | 80 |
| CODEX_DEFAULT_REASONING_EFFORT | No | Default reasoning effort (low, medium, high, xhigh, max). | max |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Guarded Codex CLI execution worker (default gpt-6.2-sol, reasoning_effort=max). Provide allowed_paths/forbidden_paths on write orders, audit guard_audit and observed_evidence, reuse workspace cache lanes, and use codex_batch_exec for disjoint parallel tasks.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| codex_execA | Execute a scoped, guarded coding or shell Work Order on Codex CLI (default model="gpt-6.2-sol", reasoning_effort="max"). Enforces real-time destructive command blocking, file-scope whitelist/blacklist verification (allowed_paths/forbidden_paths with auto-revert), spin-loop circuit breaking, lean prefix stripping, persistent workspace cache lanes, and 2-field {"ok","err"} JSON ACK. |
| codex_batch_execB | Execute up to 6 independent Codex work orders in parallel on separate cache lanes. Enforces strictly disjoint allowed_paths for write tasks sharing a workspace, isolates concurrent sibling edits in Git, runs all runtime guardrails on each worker, and returns consolidated ground-truth reports. |
| codex_resumeC | Send a guarded follow-up or fix directive to an existing thread_id while preserving cache-identical flags and runtime guardrails. |
| codex_job_statusB | Inspect live progress (active command, commands executed) or final ground-truth report, guard_audit, and cache_metrics for a job. Omit job_id to list recent jobs. Supports wait_sec (0-60). |
| codex_job_cancelA | Immediately terminate a stuck, looping, or off-track Codex worker process tree. |
| codex_cache_manageC | Inspect, reset, or prune persistent workspace cache lanes (thread_id, context fill %, last-call cache hit %, idle age, busy state). |
| codex_healthB | Verify Codex binary discovery, CLI version, model catalog readiness, runtime guardrail defaults, active cache lanes, and recent jobs. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 7 tools
Each tool maps to a distinct lifecycle stage: single execution, batch execution, status inspection, cancellation, resume, cache management, and health checking. The only mild overlap is between codex_exec, codex_batch_exec, and codex_resume, since all can start or continue coding work, but descriptions clearly differentiate new jobs, parallel jobs, and follow-ups to existing threads.
All names use a consistent snake_case codex_ prefix, making the family easy to recognize. However, the suffix ordering is mixed: some are object_action (codex_job_status, codex_cache_manage) and others are action or bare noun (codex_exec, codex_resume, codex_health), which is a minor inconsistency but still readable.
Seven tools is well-scoped for a Codex worker orchestration server. Each tool covers a meaningful capability—execution, monitoring, cancellation, resumption, batching, cache control, and health—without obvious redundancy.
The surface covers the full worker lifecycle: launch single or batch jobs, inspect status, cancel stuck jobs, resume threads, manage cache lanes, and verify environment health. No obvious operational gaps remain for the stated purpose.