codexappserver

package
v0.4.13 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package codexappserver provides the narrow Codex protocol boundary used by Atlas evaluations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client owns one initialized app-server connection and the local process cleanup boundary available on this host.

func Start

func Start(ctx context.Context, options StartOptions) (*Client, error)

Start checks the prepared Codex launcher digest immediately before starting and initializes one app-server connection.

func (*Client) Close

func (client *Client) Close(ctx context.Context) error

Close terminates the app-server leader and every descendant qualified by the host tracker with a fresh cleanup budget.

func (*Client) InterruptTurn

func (client *Client) InterruptTurn(ctx context.Context, threadID string, turnID string) error

InterruptTurn asks Codex to cancel an active turn before process-group cleanup begins.

func (*Client) Notifications

func (client *Client) Notifications() <-chan Notification

Notifications returns normalized server notifications in protocol order.

func (*Client) NotificationsDropped

func (client *Client) NotificationsDropped() uint64

NotificationsDropped returns the number of lifecycle notifications discarded because the telemetry queue exceeded its message or byte limit.

func (*Client) NotificationsDroppedBytes

func (client *Client) NotificationsDroppedBytes() uint64

NotificationsDroppedBytes returns the encoded lifecycle bytes discarded by the bounded telemetry queue.

func (*Client) StartThread

func (client *Client) StartThread(ctx context.Context, options ThreadOptions) (Thread, error)

StartThread creates a new thread and returns the effective identity reported by Codex.

func (*Client) StartTurn

func (client *Client) StartTurn(ctx context.Context, threadID string, prompt string) (Turn, error)

StartTurn submits one natural-language task to a fresh evaluation thread.

func (*Client) Stderr

func (client *Client) Stderr() string

Stderr returns a snapshot of app-server diagnostics captured outside the candidate Project.

func (*Client) StderrDropped

func (client *Client) StderrDropped() uint64

StderrDropped returns the number of stderr bytes omitted from retained diagnostics.

func (*Client) UserAgent

func (client *Client) UserAgent() string

UserAgent returns the provider version reported during the initialized protocol handshake.

type Notification

type Notification struct {
	Method string
	Params json.RawMessage
}

Notification is one app-server lifecycle message not paired with a client request.

type PreparedLauncher

type PreparedLauncher struct {
	Candidate string
	Path      string
	Digest    string
}

PreparedLauncher binds the configured launcher name to the path and bytes resolved during preparation.

func ResolveLauncher

func ResolveLauncher(candidate string) (PreparedLauncher, error)

ResolveLauncher returns the resolved launcher path and SHA-256 digest of its current bytes.

type StartOptions

type StartOptions struct {
	Launcher  PreparedLauncher
	Arguments []string
	Dir       string
	Env       []string
}

StartOptions configures one private Codex app-server process.

type Thread

type Thread struct {
	ID                 string
	Model              string
	ModelProvider      string
	ApprovalPolicy     string
	Sandbox            string
	InstructionSources []string
	Ephemeral          bool
}

Thread describes the effective identity and guidance returned by Codex.

type ThreadOptions

type ThreadOptions struct {
	Model           string
	ModelProvider   string
	Dir             string
	ApprovalPolicy  string
	Sandbox         string
	ServiceName     string
	Ephemeral       bool
	Configuration   map[string]any
	DeveloperPrompt string
}

ThreadOptions defines the attributable inputs for one fresh evaluation thread.

type Turn

type Turn struct {
	ID string
}

Turn identifies one active request within a thread.

Jump to

Keyboard shortcuts

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