codex

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 12 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractResultFromLog

func ExtractResultFromLog(logPath string) string

ExtractResultFromLog scans a Codex JSON log file and returns the text of the last agent_message item, or "" if none found.

func NewAdapter

func NewAdapter(binaryPath, openbeeURL string) (ai.EngineAdapter, error)

Types

type Invoker

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

Invoker spawns Codex CLI processes and is safe for concurrent use.

func NewInvoker

func NewInvoker(binary, openbeeURL string, store *SessionStore) *Invoker

NewInvoker creates an Invoker. openbeeURL is injected as OPENBEE_URL into subprocesses.

func (*Invoker) Run

func (inv *Invoker) Run(ctx context.Context, workDir, prompt string, opts ai.RunOptions, logPath string) (ai.Process, <-chan ai.Output, error)

Run starts a Codex CLI process, redirecting output to logPath. For new sessions, prompt is passed via stdin; for resumes, the thread_id is resolved from the store.

type SessionStore

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

SessionStore maps openbee session UUIDs to codex thread IDs on disk. Per-session files avoid concurrent write conflicts between sessions.

func NewSessionStore

func NewSessionStore() (*SessionStore, error)

NewSessionStore creates a SessionStore rooted at the default location.

func (*SessionStore) Get

func (s *SessionStore) Get(openbeeUUID string) (string, bool)

func (*SessionStore) Set

func (s *SessionStore) Set(openbeeUUID, threadID string) error

Set writes the codex thread_id for the given openbee UUID. Writes are atomic via temp-file rename.

Jump to

Keyboard shortcuts

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