Documentation
¶
Overview ¶
Package codexhome owns per-thread CODEX_HOME tmpdirs: creation, destruction, and the rendering of the config.toml fragment we plant inside each one before spawning `codex app-server`.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrObjectNotFound = errors.New("codexhome: object not found")
ErrObjectNotFound is returned by ObjectStore.Get when a key is absent.
Functions ¶
func RenderConfigTOML ¶
func RenderConfigTOML(cfg ConfigInput) (string, error)
RenderConfigTOML produces the TOML body. Pure function so tests can assert exact substrings without filesystem.
Types ¶
type AgentServerMCP ¶ added in v0.51.0
type AgentServerMCP struct {
CodexBin string // absolute path to codex-app-gateway binary
WorkspaceID string
ExecGatewayURL string // ws base URL; env-mcp appends /<exe_id>
AppGatewayInternalURL string // http base for /internal/connected loopback
WorkspaceToken string // workspace-scoped cap token (env-injected)
LoopbackToken string // per-spawn loopback token (env-injected)
}
AgentServerMCP carries everything codexhome needs to emit one fixed `[mcp_servers.agentserver]` block per the 2026-05-16 redesign. One env-mcp child per codex app-server handles every executor in the workspace via env_id routing — no per-executor sections.
type ConfigInput ¶
type ConfigInput struct {
ModelProvider string
Model string
ModelProviders map[string]ModelProvider
AgentServer AgentServerMCP
ProjectTrustedPaths []string
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager creates per-thread CODEX_HOME tmpdirs under root.
func NewManager ¶
func (*Manager) RemoveTmpDir ¶
RemoveTmpDir removes a previously-created tmpdir tree, but refuses to remove anything outside the manager's root.
func (*Manager) WriteConfig ¶
func (m *Manager) WriteConfig(codexHome string, cfg ConfigInput) error
WriteConfig renders `config.toml` into the given CODEX_HOME dir.
type ModelProvider ¶
type ObjectStore ¶
type ObjectStore interface {
Put(ctx context.Context, key string, data []byte) error
Get(ctx context.Context, key string) ([]byte, error)
Delete(ctx context.Context, key string) error
}
ObjectStore is the seam between codexhome and the S3 client. Real callers wire in a thin wrapper around aws-sdk-go-v2; tests use a map-backed fake.
type S3Backend ¶
type S3Backend struct {
// contains filtered or unexported fields
}
S3Backend round-trips a single workspace CODEX_HOME tree.
func NewS3Backend ¶
func NewS3Backend(store ObjectStore, workspaceID string) *S3Backend
func (*S3Backend) Download ¶
Download fetches the tarball and untars into dst (which must exist and be owned by the caller).