codex

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package codex is the Codex CLI provider (ADR-0019). It is built from a reading of Codex's source at commit c9035417 (tag rust-v0.168.0-alpha.3). No real session checked it, so it is unverified: smif shows these sessions and never types into them, forks them or installs hooks for them.

Codex keeps no live file for a session, so no file links a pid to a session. Smif matches by ps and folder: a codex process on a terminal owns the rollout with its folder that was written since the process started. `codex resume <id>` names its session in argv. Two processes in one folder get the rollouts newest to newest, which can swap them when the newer process resumed an older session. A process with no such rollout (Codex writes the file at the first prompt) shows at the Listed level instead. Rollouts compressed to .jsonl.zst are skipped: they are cold, and reading them needs a new dependency.

Index

Constants

View Source
const Name = "codex"

Name is the harness name of Codex sessions.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proc

type Proc = harness.Proc

Proc is a process that may be a Codex session.

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider reads one Codex home folder.

func New

func New(dir string) *Provider

New returns the provider for a home folder ("" reads nothing).

func NewWithProcs

func NewWithProcs(dir string, procs func() []Proc) *Provider

NewWithProcs takes the process list from procs: tests use it.

func (*Provider) Check

func (p *Provider) Check() (state, detail string)

Check compares the newest rollouts on this machine with the source reading. The detail names counts only, never a value from a file.

func (*Provider) Discover

func (p *Provider) Discover() []harness.Session

Discover returns the sessions a live codex process owns. With no rollout folder it runs no ps, so a machine without Codex pays only a stat.

func (*Provider) Info

func (p *Provider) Info() harness.Info

Info names the provider. Verified stays false until a real session checks it and docs/compat.md has a row with that version.

func (*Provider) Read

func (p *Provider) Read(sessionID string, limit int) harness.Reading

Read reads a session's rollout.

func (*Provider) Stamp

func (p *Provider) Stamp(sessionID string) string

Stamp is the rollout's path, size and time.

func (*Provider) State

func (p *Provider) State(s harness.Session) (string, time.Time)

State is what the rollout's end says. A rollout records no approval, so an open turn with a tool call and no result gives "": a running tool looks the same as an approval prompt. Discover already checked the process, so a turn left open by a crash does not show as busy.

Jump to

Keyboard shortcuts

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