codex

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package codex implements adapters.HarnessAdapter for the Codex CLI.

Run() forks `codex exec` with signal forwarding and exit normalisation. Unlike the claude adapter, session persistence, payload-patch application, and boid task notify integration are not wired.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct{}

Adapter implements adapters.HarnessAdapter for the Codex CLI.

func New

func New() *Adapter

New returns a new Adapter.

func (*Adapter) Bindings

func (a *Adapter) Bindings(homeDir string) []adapters.BindMount

Bindings declares the host bind-mounts codex.Adapter.Run() needs inside the sandbox.

Returns nil: codex CLI state and skills reach the sandbox via the workspace HOME volume (internal/dispatcher/workspace_home.go) and dispatcher-owned skill mounts (skills_overlay.go) instead of an adapter-declared bind. The codex CLI binary itself is expected to be installed into that workspace home by the workspace's init.sh; a missing binary fails fast with an explicit message from Run() (run.go's missingCLIError).

func (*Adapter) Run

Run forks codex. Interactive vs non-interactive is keyed off rc.TaskID: session jobs (JobKindSession) carry no task and are user-initiated, so they land in interactive TUI mode; hook jobs carry a BOID_TASK_ID and fall through to non-interactive `codex exec`. This mirrors how the claude adapter discriminates JobKindSession from JobKindHook via rc.TaskID == "".

Other responsibilities mirror the claude / opencode adapters: signal forwarding via sigutil, exit code normalisation for daemon-initiated stops, PWD strip on the child env, and cmd.Dir as the source of truth for the workdir.

Session persistence and payload-patch application are deliberately NOT wired here — interactive sessions are run-and-done, no resume yet.

func (*Adapter) Usage

func (a *Adapter) Usage(_ context.Context, _ string) (adapters.Usage, error)

Usage is not yet implemented; awaits the jobs table gaining usage columns and a per-run token/cost surface for this harness.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL