Codex.Thread.Options (Codex SDK v0.6.0)

Copy Markdown View Source

Per-thread configuration options.

Summary

Functions

Builds a thread options struct from various inputs.

Types

collaboration_mode()

@type collaboration_mode() :: Codex.Protocol.CollaborationMode.t()

color()

@type color() :: :always | :never | :auto | String.t()

config_override()

@type config_override() :: String.t() | {String.t() | atom(), term()}

history_persistence()

@type history_persistence() :: String.t()

model_verbosity()

@type model_verbosity() :: :low | :medium | :high | String.t()

network_access()

@type network_access() :: :enabled | :restricted

personality()

@type personality() :: Codex.Protocol.ConfigTypes.personality()

rate_limit_opts()

@type rate_limit_opts() :: keyword()

reasoning_summary()

@type reasoning_summary() :: :auto | :concise | :detailed | :none | String.t()

retry_opts()

@type retry_opts() :: keyword()

sandbox()

@type sandbox() ::
  :default
  | :strict
  | :permissive
  | :read_only
  | :workspace_write
  | :danger_full_access
  | :external_sandbox
  | {:external_sandbox, network_access()}
  | String.t()

sandbox_policy()

@type sandbox_policy() :: %{
  optional(:type) => sandbox_policy_type(),
  optional(:writable_roots) => [String.t()],
  optional(:network_access) => boolean() | :enabled | :restricted | String.t(),
  optional(:exclude_tmpdir_env_var) => boolean(),
  optional(:exclude_slash_tmp) => boolean()
}

sandbox_policy_type()

@type sandbox_policy_type() ::
  :danger_full_access
  | :read_only
  | :workspace_write
  | :external_sandbox
  | String.t()

t()

@type t() :: %Codex.Thread.Options{
  additional_directories: [String.t()],
  apply_patch_freeform_enabled: boolean() | nil,
  approval_hook: module() | nil,
  approval_policy: module() | nil,
  approval_timeout_ms: pos_integer(),
  ask_for_approval:
    :untrusted | :on_failure | :on_request | :never | String.t() | nil,
  attachments: [map()] | [],
  auto_run: boolean(),
  base_instructions: String.t() | nil,
  collaboration_mode: collaboration_mode() | nil,
  color: color() | nil,
  compact_prompt: String.t() | nil,
  config: map() | nil,
  config_overrides: [config_override()],
  dangerously_bypass_approvals_and_sandbox: boolean(),
  developer_instructions: String.t() | nil,
  experimental_raw_events: boolean(),
  file_search: Codex.FileSearch.t() | nil,
  full_auto: boolean(),
  history_max_bytes: non_neg_integer() | nil,
  history_persistence: history_persistence() | nil,
  labels: map(),
  local_provider: String.t() | nil,
  metadata: map(),
  model: String.t() | nil,
  model_context_window: pos_integer() | nil,
  model_provider: String.t() | nil,
  model_reasoning_summary: reasoning_summary() | nil,
  model_supports_reasoning_summaries: boolean() | nil,
  model_verbosity: model_verbosity() | nil,
  network_access_enabled: boolean() | nil,
  oss: boolean(),
  output_last_message: String.t() | nil,
  output_schema: map() | nil,
  personality: personality() | nil,
  profile: String.t() | nil,
  rate_limit: boolean() | nil,
  rate_limit_opts: rate_limit_opts() | nil,
  request_max_retries: pos_integer() | nil,
  retry: boolean() | nil,
  retry_opts: retry_opts() | nil,
  sandbox: sandbox(),
  sandbox_policy: sandbox_policy() | sandbox_policy_type() | nil,
  shell_environment_policy: map() | nil,
  show_raw_agent_reasoning: boolean(),
  skills_enabled: boolean() | nil,
  skip_git_repo_check: boolean(),
  stream_idle_timeout_ms: pos_integer() | nil,
  stream_max_retries: pos_integer() | nil,
  transport: transport(),
  unified_exec_enabled: boolean() | nil,
  view_image_tool_enabled: boolean() | nil,
  web_search_enabled: boolean(),
  web_search_mode: web_search_mode(),
  working_directory: String.t() | nil
}

transport()

@type transport() :: :exec | {:app_server, pid()}

web_search_mode()

@type web_search_mode() :: Codex.Protocol.ConfigTypes.web_search_mode()

Functions

new(opts)

@spec new(map() | keyword() | t()) :: {:ok, t()} | {:error, term()}

Builds a thread options struct from various inputs.