Documentation
¶
Overview ¶
Package codex is the Codex harness adapter. It drives one long-running `codex app-server` process over JSON-RPC on stdio (CONTRACT.md):
- CODEX_HOME is <runner>/codex on the seat volume, so threads (rollouts and state databases) survive Pod replacement and resume natively;
- config.toml points a custom provider at the seat's model forwarder (wire_api "responses", the only API Codex speaks) with a placeholder key, and adds steadmesh-tools as a required stdio MCP server whose tools are approved without prompting;
- threads run with approval policy "never" and danger-full-access: the seat Pod is the boundary;
- a turn is turn/start ... turn/completed; interruption is turn/interrupt.
Checkpoint = thread id + Codex version (application_checkpoint). A thread that cannot be resumed is replaced by a new one seeded with the portable handoff, and the turn reports it.
Index ¶
- Constants
- func ConfigTOML(env harnesses.Environment) string
- type Adapter
- func (a *Adapter) Checkpoint(ctx context.Context) (runtimeapi.Checkpoint, error)
- func (a *Adapter) Deliver(ctx context.Context, d harnesses.Delivery) (harnesses.TurnResult, error)
- func (a *Adapter) DescribeCapabilities() harnesses.Capabilities
- func (a *Adapter) Events() <-chan harnesses.Event
- func (a *Adapter) Prepare(ctx context.Context, env harnesses.Environment) error
- func (a *Adapter) Quiesce(ctx context.Context) (harnesses.QuiesceResult, error)
- func (a *Adapter) StartOrResume(ctx context.Context, rec harnesses.RecoveryDescriptor) (harnesses.ResumeResult, error)
- func (a *Adapter) Stop(ctx context.Context) error
- type SessionState
Constants ¶
View Source
const ( // AdapterName is the harness profile adapter value. AdapterName = "codex" // PinnedVersion is the verified Codex release (CONTRACT.md). PinnedVersion = "0.160.1" // SessionFormatPrefix prefixes Checkpoint.FormatVersion. SessionFormatPrefix = "codex-thread/" // MCPServerName is the tool bridge's server name; Codex presents its // tools in the Responses namespace mcp__steadmesh. MCPServerName = "steadmesh" // ProviderID is the custom model provider; built-in IDs are reserved. ProviderID = "steadmesh" // SettingReasoningEffort is passed as turn/start effort. SettingReasoningEffort = "reasoning_effort" )
View Source
const ( ConfigBinary = "codex_bin" // default "codex" ConfigVersion = "version" // when set, Prepare requires exactly this version ConfigInterruptGrace = "interrupt_grace" // Go duration, default 15s )
Harness profile config keys.
Variables ¶
This section is empty.
Functions ¶
func ConfigTOML ¶
func ConfigTOML(env harnesses.Environment) string
ConfigTOML renders $CODEX_HOME/config.toml (CONTRACT.md §2, §3, §5).
Types ¶
type Adapter ¶
type Adapter struct {
// Tap, when set before StartOrResume, receives every raw protocol line.
Tap func(line []byte)
// contains filtered or unexported fields
}
Adapter runs Codex.
func (*Adapter) Checkpoint ¶
func (a *Adapter) Checkpoint(ctx context.Context) (runtimeapi.Checkpoint, error)
func (*Adapter) DescribeCapabilities ¶
func (a *Adapter) DescribeCapabilities() harnesses.Capabilities
func (*Adapter) StartOrResume ¶
func (a *Adapter) StartOrResume(ctx context.Context, rec harnesses.RecoveryDescriptor) (harnesses.ResumeResult, error)
Click to show internal directories.
Click to hide internal directories.