mirror of
https://github.com/openai/codex.git
synced 2026-11-11 21:10:39 +00:00
Add a thread-store builder with host cleanup support (#58954)
## What changed Replace `thread_store_from_config` with `ThreadStoreBuilder`, exported through `codex_core` and `codex_core_api`, and migrate callers to the builder. Allow hosts to register `with_additional_cleanup` for permanent deletion in local stores. The callback runs after successful agent-board cleanup and before rollout deletion, under the existing deletion locks. Document that cleanup must be idempotent and must avoid thread-store operations that reacquire those locks. In-memory stores do not invoke the callback. Preserve the existing backend selection, startup rollout migration, and compression behavior. GitOrigin-RevId: f2853d7de06fe12ef29451b204cf9fcbb349c359
This commit is contained in:
@@ -80,6 +80,7 @@ use codex_app_server_protocol::experimental_required_message;
|
||||
use codex_arg0::Arg0DispatchPaths;
|
||||
use codex_code_mode::CodeModeSessionProvider;
|
||||
use codex_core::ThreadManager;
|
||||
use codex_core::ThreadStoreBuilder;
|
||||
use codex_core::config::Config;
|
||||
use codex_core::config::ThreadStoreConfig;
|
||||
use codex_exec_server::EnvironmentManager;
|
||||
@@ -317,7 +318,8 @@ impl MessageProcessor {
|
||||
// The thread store is intentionally process-scoped. Config reloads can
|
||||
// affect per-thread behavior, but they must not move newly started,
|
||||
// resumed, or forked threads to a different persistence backend/root.
|
||||
let thread_store = codex_core::thread_store_from_config(config.as_ref(), state_db.clone());
|
||||
let thread_store =
|
||||
ThreadStoreBuilder::from_config(config.as_ref(), state_db.clone()).build();
|
||||
// Queue persistence requires SQLite, so in-memory thread stores and
|
||||
// app servers without a state database do not have a queue backend.
|
||||
let queue_store: Option<Arc<dyn QueueStore>> = match &config.experimental_thread_store {
|
||||
|
||||
Reference in New Issue
Block a user