Skip to main content

Crate codex_core

Crate codex_core 

Source
Expand description

Root of the codex-core library.

Re-exports§

pub use compact::content_items_to_text;
pub use codex_prompts as review_prompts;

Modules§

compact
config
connectors
context
Context fragments injected into model input.
exec
exec_env
otel_init
path_utils
sandboxing
shell
skills
spawn
test_support
Test-only helpers exposed for cross-crate integration tests.
util
windows_sandbox

Macros§

feedback_tags
Emit structured feedback metadata as key/value pairs.

Structs§

AttestationContext
Request context that host integrations can use when deciding whether to generate an attestation header value.
BackgroundTerminalInfo
CodexResponsesMetadata
Caller-owned snapshot of Codex metadata sent to ResponsesAPI.
CodexThread
CodexThreadSettingsOverrides
Thread settings overrides that app-server validates before starting a turn.
Cursor
Pagination cursor identifying the last item in a page.
LoadedAgentsMd
Model-visible instructions loaded from AGENTS.md files and internal guidance.
McpManager
ModelClient
A session-scoped client for model-provider API calls.
ModelClientSession
A turn-scoped streaming session created from a ModelClient.
ModelProviderAuthInfo
Configuration for obtaining a provider bearer token from a command.
NewThread
Represents a newly created Codex thread (formerly called a conversation), including the first event (which is EventMsg::SessionConfigured).
Prompt
API request payload for a single model turn
ResponseStream
RolloutRecorder
Writes canonical session rollout items to JSONL.
SandboxState
SessionMeta
SessionMeta contains session-level data that doesn’t correspond to a specific turn.
StartThreadOptions
ThreadConfigSnapshot
ThreadItem
Summary information for a thread rollout file.
ThreadManager
ThreadManager is responsible for creating threads and maintaining them in memory.
ThreadShutdownReport
ThreadsPage
Returned page of thread (thread) summaries.
TryStartTurnIfIdleError
Rejection returned when an extension asks to start automatic idle work but the thread is not eligible to run it.
TurnContext
The context needed for a single turn of the thread.

Enums§

ExecPolicyError
ForkSnapshot
ResponseEvent
RolloutRecorderParams
SortDirection
SteerInputError
ThreadSortKey
TryStartTurnIfIdleRejectionReason
Explains why CodexThread::try_start_turn_if_idle rejected an automatic idle turn.

Constants§

ARCHIVED_SESSIONS_SUBDIR
DEFAULT_AGENTS_MD_FILENAME
Default filename scanned for AGENTS.md instructions.
LOCAL_AGENTS_MD_FILENAME
Preferred local override for AGENTS.md instructions.
PLUGIN_TEXT_MENTION_SIGIL
Plugins use @ in linked plaintext outside TUI.
REVIEW_PROMPT
Review thread system prompt.
SESSIONS_SUBDIR
TOOL_MENTION_SIGIL
Default plaintext sigil for tools.
X_CODEX_INSTALLATION_ID_HEADER
X_CODEX_TURN_METADATA_HEADER
X_RESPONSESAPI_INCLUDE_TIMING_METRICS_HEADER

Statics§

INTERACTIVE_SESSION_SOURCES

Traits§

AttestationProvider
Host integration boundary for just-in-time attestation header values.
TimeProvider
Host integration boundary for reading and waiting on the current time.

Functions§

append_thread_name
Append a thread name update to the session index. Name updates are append-only; the most recent entry wins when resolving names or ids.
build_models_manager
check_execpolicy_for_warnings
detached_memory_responses_metadata
find_archived_thread_path_by_id_str
Locate an archived thread rollout file by its UUID string.
find_conversation_path_by_id_str
Locate a recorded thread rollout file by its UUID string using the existing paginated listing implementation. Returns Ok(Some(path)) if found, Ok(None) if not present or the id is invalid.
find_thread_meta_by_name_str
Locate a recorded thread rollout and read its session metadata by thread name. Returns the newest indexed name that still has a readable rollout header.
find_thread_name_by_id
Find the latest thread name for a thread id, if any.
find_thread_names_by_ids
Find the latest thread names for a batch of thread ids.
find_thread_path_by_id_str
Locate a recorded thread rollout file by its UUID string using the existing paginated listing implementation. Returns Ok(Some(path)) if found, Ok(None) if not present or the id is invalid.
format_exec_policy_error_with_source
grant_read_root_non_elevated
init_state_db
load_exec_policy
local_agent_graph_store_from_state_db
Construct the default SQLite-backed agent graph store when local state is available.
parse_cursor
Pagination cursor token format: an RFC3339 timestamp with an optional thread ID tie-breaker.
parse_turn_item
read_head_for_summary
Read up to HEAD_RECORD_LIMIT records from the start of the rollout file at path. This should be enough to produce a summary including the session meta line.
read_session_meta_line
Read the SessionMetaLine from the head of a rollout file for reuse by callers that need the session metadata (e.g. to derive a cwd for config).
resolve_installation_id
rollout_date_parts
Extract the YYYY/MM/DD directory components from a rollout filename.
thread_store_from_config
truncate_rollout_after_turn_id
Return a rollout prefix ending after the requested persisted terminal turn.
truncate_rollout_before_turn_id
Return a rollout prefix ending immediately before the requested persisted turn.
web_search_action_detail

Type Aliases§

CodexAppsToolsCache
Backward-compatible name for the shared Codex Apps tools runtime.
CodexConversationDeprecated
ConversationManagerDeprecated
GenerateAttestationFuture
NewConversationDeprecated
SleepFuture
StateDbHandle
Core-facing handle to the SQLite-backed state runtime.
TimeFuture