CodexEx.AppServer.ThreadSettings (codex_ex v0.2.0)

Copy Markdown View Source

Effective Codex settings observed for a loaded thread.

App-created threads retain the private instruction seed needed to replay the settings exactly. Imported threads expose effective settings without a private instruction seed; their fork leaves developer instructions to Codex.

Summary

Functions

Applies the complete sticky settings notification to an existing snapshot.

Decodes the private persisted seed without guessing at missing values.

Builds effective settings and records whether their instruction seed is replayable.

Returns the private persisted seed needed to reconstruct root instructions on resume.

Applies a persisted source seed to a new thread/fork request.

Returns side-chat fork settings without replacing unknown parent instructions.

Types

approval_policy()

@type approval_policy() :: binary() | map()

instruction_seed()

@type instruction_seed() :: %{
  developer_instructions: binary() | nil,
  personality: binary() | nil,
  reasoning_summary: binary() | nil
}

instruction_seed_input()

@type instruction_seed_input() :: %{
  :developer_instructions => binary() | nil,
  :personality => binary() | nil,
  :reasoning_summary => binary() | nil,
  optional(term()) => term()
}

t()

@type t() :: %CodexEx.AppServer.ThreadSettings{
  active_permission_profile_id: binary() | nil,
  approval_policy: approval_policy(),
  approvals_reviewer: binary(),
  cwd: binary(),
  developer_instructions: binary() | nil,
  model: binary(),
  model_provider: binary(),
  personality: binary() | nil,
  reasoning_effort: binary() | nil,
  reasoning_summary: binary() | nil,
  replayable?: boolean(),
  runtime_workspace_roots: [term()],
  sandbox_policy: map(),
  service_tier: binary() | nil
}

Functions

apply_notification(current, update)

@spec apply_notification(
  t(),
  struct()
) :: {:ok, t()} | {:error, :invalid_thread_settings}

Applies the complete sticky settings notification to an existing snapshot.

decode_persisted_seed(arg1)

@spec decode_persisted_seed(term()) ::
  {:ok, instruction_seed()} | {:error, :invalid_thread_settings_seed}

Decodes the private persisted seed without guessing at missing values.

from_protocol(source, arg2)

@spec from_protocol(map(), instruction_seed_input() | nil) :: t() | nil

Builds effective settings and records whether their instruction seed is replayable.

persisted_seed(settings)

@spec persisted_seed(t() | nil) :: map() | nil

Returns the private persisted seed needed to reconstruct root instructions on resume.

put_persisted_seed(params, seed)

@spec put_persisted_seed(map(), map() | nil) ::
  {:ok, map()} | {:error, :invalid_thread_settings_seed}

Applies a persisted source seed to a new thread/fork request.

side_fork_overrides(settings)

@spec side_fork_overrides(t()) :: {:ok, map()} | {:error, :settings_unavailable}

Returns side-chat fork settings without replacing unknown parent instructions.