AgentHarness.Providers.Codex.Client.Exec (AgentHarness v0.3.0)

Copy Markdown View Source

Codex client that runs codex app-server through an AgentHarness.Exec implementation instead of the SDK's subprocess transport.

Only connect/2 differs from Client.SDK: the app-server is spawned via AgentHarness.Providers.Codex.ExecConnection, whose pid satisfies the same call contract as the SDK's own connections, so threads, turns, approvals, and interrupts flow through the ordinary SDK code paths.

Select it per session with auth: :inherit (the fail-closed :subscription mode inspects local Codex state by design):

provider_options: %{
  auth: :inherit,
  exec: {MyApp.SandboxExec, sandbox: sandbox}
}

The spawn spec is remote-safe: the executable (codex or the configured codex_path) resolves in the execution environment, and only explicit entries are forwarded — the SDK credential/base-url overrides and the session's process_env. Model routing config (model_payload) is not translated into app-server flags; set the model per thread instead.