Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
codex-router
command
Command codex-router routes Codex CLI requests to a model and reasoning effort per step.
|
Command codex-router routes Codex CLI requests to a model and reasoning effort per step. |
|
internal
|
|
|
appserver
Package appserver is a second client of the session's private Codex app-server: JSON-RPC 2.0 over a Dialer (WebSocket over the unix socket per research §3.6, with a newline JSON-RPC fallback).
|
Package appserver is a second client of the session's private Codex app-server: JSON-RPC 2.0 over a Dialer (WebSocket over the unix socket per research §3.6, with a newline JSON-RPC fallback). |
|
catalog
Package catalog reads the Codex model catalog (GET {base_url}/models, or $CODEX_HOME/models_cache.json read-only) and answers two questions: which models share a compatibility group, and how large a model's usable context window is.
|
Package catalog reads the Codex model catalog (GET {base_url}/models, or $CODEX_HOME/models_cache.json read-only) and answers two questions: which models share a compatibility group, and how large a model's usable context window is. |
|
classifier
Package classifier asks an external model which tier and activity a prompt needs.
|
Package classifier asks an external model which tier and activity a prompt needs. |
|
config
Package config holds the router configuration: tiers, activities, routes, policy, classifiers, and the JSON file under the XDG config dir they load from.
|
Package config holds the router configuration: tiers, activities, routes, policy, classifiers, and the JSON file under the XDG config dir they load from. |
|
control
Package control is the router's local control channel: JSON lines over a 0600 unix socket.
|
Package control is the router's local control channel: JSON lines over a 0600 unix socket. |
|
cost
Package cost keeps the prompt-cache ledger per thread and model and prices a switch in uncached tokens, with USD only when a model has list prices.
|
Package cost keeps the prompt-cache ledger per thread and model and prices a switch in uncached tokens, with USD only when a model has list prices. |
|
facts
Package facts derives what the policy needs from one Responses request: the prompt and recent dialogue for the classifier, a repeated tool-failure signature, the activity the tools show, whether a verification passed, and a context size estimate.
|
Package facts derives what the policy needs from one Responses request: the prompt and recent dialogue for the classifier, a repeated tool-failure signature, the activity the tools show, whether a verification passed, and a context size estimate. |
|
hook
Package hook implements `codex-router hook`, the optional Codex command hook (UserPromptSubmit, Stop) that prints a systemMessage when the route changed since the previous turn.
|
Package hook implements `codex-router hook`, the optional Codex command hook (UserPromptSubmit, Stop) that prints a systemMessage when the route changed since the previous turn. |
|
launcher
Package launcher runs one routed Codex session: it makes the runtime dir, starts and probes the proxy, starts the private app-server with -c overrides only, connects the router client, wires the engine to the app-server and control socket, then runs `codex --remote`.
|
Package launcher runs one routed Codex session: it makes the runtime dir, starts and probes the proxy, starts the private app-server with -c overrides only, connects the router client, wires the engine to the app-server and control socket, then runs `codex --remote`. |
|
policy
Package policy decides the tier for a step: escalation on a repeated tool failure, holds, votes with hysteresis, cost-gated upgrade and downgrade bars, and the context-fit tier search.
|
Package policy decides the tier for a step: escalation on a repeated tool failure, holds, votes with hysteresis, cost-gated upgrade and downgrade bars, and the context-fit tier search. |
|
proxy
Package proxy is the loopback Responses proxy: POST /v1/responses and GET /v1/models go to the fixed ChatGPT backend with no redirects; SSE streams through unchanged except for the stripped model headers.
|
Package proxy is the loopback Responses proxy: POST /v1/responses and GET /v1/models go to the fixed ChatGPT backend with no redirects; SSE streams through unchanged except for the stripped model headers. |
|
responses
Package responses models the Codex Responses request as the proxy sees it: the body fields the router reads or rewrites (model, reasoning.effort, input items), the turn metadata header, the request kind, and the usage reported in the response.completed SSE event.
|
Package responses models the Codex Responses request as the proxy sees it: the body fields the router reads or rewrites (model, reasoning.effort, input items), the turn metadata header, the request kind, and the usage reported in the response.completed SSE event. |
|
route
Package route is the router engine: it keys state by thread, turn and request fingerprint, asks the classifier on a turn's first step and in background reviews, runs the policy, checks the compatibility group and context fit, pins a decision for retries, and publishes decisions and snapshots.
|
Package route is the router engine: it keys state by thread, turn and request fingerprint, asks the classifier on a turn's first step and in background reviews, runs the policy, checks the compatibility group and context fit, pins a decision for retries, and publishes decisions and snapshots. |
|
tui
Package tui is the router panel: a Bubble Tea program over the control socket with tabs Now, Routes, Policy, Classifier and Usage, modelled on the claude-model-router 1.13.0 /router pane.
|
Package tui is the router panel: a Bubble Tea program over the control socket with tabs Now, Routes, Policy, Classifier and Usage, modelled on the claude-model-router 1.13.0 /router pane. |
|
scripts
|
|
|
render-docs
command
Command render-docs draws the pictures in docs/images from the real TUI renderer and a sample snapshot.
|
Command render-docs draws the pictures in docs/images from the real TUI renderer and a sample snapshot. |
Click to show internal directories.
Click to hide internal directories.