mirror of
https://github.com/openai/codex.git
synced 2026-11-10 21:00:47 +00:00
Refine rollout crate extraction
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -218,9 +218,10 @@ use codex_core::plugins::PluginReadRequest;
|
||||
use codex_core::plugins::PluginUninstallError as CorePluginUninstallError;
|
||||
use codex_core::plugins::load_plugin_apps;
|
||||
use codex_core::plugins::load_plugin_mcp_servers;
|
||||
use codex_core::rollout_config;
|
||||
use codex_core::sandboxing::SandboxPermissions;
|
||||
use codex_core::state_db::StateDbHandle;
|
||||
use codex_core::state_db::get_state_db;
|
||||
use codex_core::state_runtime::StateDbHandle;
|
||||
use codex_core::state_runtime::get_state_db;
|
||||
use codex_core::windows_sandbox::WindowsSandboxLevelExt;
|
||||
use codex_core::windows_sandbox::WindowsSandboxSetupMode as CoreWindowsSandboxSetupMode;
|
||||
use codex_core::windows_sandbox::WindowsSandboxSetupRequest;
|
||||
@@ -265,7 +266,6 @@ use codex_protocol::user_input::UserInput as CoreInputItem;
|
||||
use codex_rmcp_client::perform_oauth_login_return_url;
|
||||
use codex_rollout::ARCHIVED_SESSIONS_SUBDIR;
|
||||
use codex_rollout::Cursor as RolloutCursor;
|
||||
use codex_rollout::RolloutConfig;
|
||||
use codex_rollout::RolloutRecorder;
|
||||
use codex_rollout::SESSIONS_SUBDIR;
|
||||
use codex_rollout::ThreadItem as RolloutThreadItem;
|
||||
@@ -329,16 +329,6 @@ use crate::thread_state::ThreadStateManager;
|
||||
const THREAD_LIST_DEFAULT_LIMIT: usize = 25;
|
||||
const THREAD_LIST_MAX_LIMIT: usize = 100;
|
||||
|
||||
fn rollout_config(config: &Config) -> RolloutConfig {
|
||||
RolloutConfig::new(
|
||||
config.codex_home.clone(),
|
||||
config.sqlite_home.clone(),
|
||||
config.cwd.clone(),
|
||||
config.model_provider_id.clone(),
|
||||
config.memories.generate_memories,
|
||||
)
|
||||
}
|
||||
|
||||
struct ThreadListFilters {
|
||||
model_providers: Option<Vec<String>>,
|
||||
source_kinds: Option<Vec<ThreadSourceKind>>,
|
||||
|
||||
@@ -10,7 +10,7 @@ use crate::error::Result as CodexResult;
|
||||
use crate::session_prefix::format_subagent_context_line;
|
||||
use crate::session_prefix::format_subagent_notification_message;
|
||||
use crate::shell_snapshot::ShellSnapshot;
|
||||
use crate::state_db;
|
||||
use crate::state_runtime;
|
||||
use crate::thread_manager::ThreadManagerState;
|
||||
use codex_features::Feature;
|
||||
use codex_protocol::AgentPath;
|
||||
@@ -371,7 +371,7 @@ impl AgentControl {
|
||||
agent_nickname: _,
|
||||
}) => {
|
||||
let (resumed_agent_nickname, resumed_agent_role) =
|
||||
if let Some(state_db_ctx) = state_db::get_state_db(&config).await {
|
||||
if let Some(state_db_ctx) = state_runtime::get_state_db(&config).await {
|
||||
match state_db_ctx.get_thread(thread_id).await {
|
||||
Ok(Some(metadata)) => (metadata.agent_nickname, metadata.agent_role),
|
||||
Ok(None) | Err(_) => (None, None),
|
||||
|
||||
+13
-19
@@ -200,16 +200,6 @@ pub(crate) struct PreviousTurnSettings {
|
||||
pub(crate) realtime_active: Option<bool>,
|
||||
}
|
||||
|
||||
fn rollout_config(config: &Config, cwd: PathBuf) -> RolloutConfig {
|
||||
RolloutConfig::new(
|
||||
config.codex_home.clone(),
|
||||
config.sqlite_home.clone(),
|
||||
cwd,
|
||||
config.model_provider_id.clone(),
|
||||
config.memories.generate_memories,
|
||||
)
|
||||
}
|
||||
|
||||
use crate::exec_policy::ExecPolicyUpdateError;
|
||||
use crate::feedback_tags;
|
||||
use crate::file_watcher::FileWatcher;
|
||||
@@ -279,6 +269,7 @@ use crate::protocol::TokenUsage;
|
||||
use crate::protocol::TokenUsageInfo;
|
||||
use crate::protocol::TurnDiffEvent;
|
||||
use crate::protocol::WarningEvent;
|
||||
use crate::rollout_config_with_cwd;
|
||||
use crate::session_startup_prewarm::SessionStartupPrewarmHandle;
|
||||
use crate::shell;
|
||||
use crate::shell_snapshot::ShellSnapshot;
|
||||
@@ -297,7 +288,7 @@ use crate::skills::resolve_skill_dependencies_for_turn;
|
||||
use crate::state::ActiveTurn;
|
||||
use crate::state::SessionServices;
|
||||
use crate::state::SessionState;
|
||||
use crate::state_db;
|
||||
use crate::state_runtime;
|
||||
use crate::tasks::GhostSnapshotTask;
|
||||
use crate::tasks::ReviewTask;
|
||||
use crate::tasks::SessionTask;
|
||||
@@ -339,7 +330,6 @@ use codex_protocol::protocol::CodexErrorInfo;
|
||||
use codex_protocol::protocol::InitialHistory;
|
||||
use codex_protocol::user_input::UserInput;
|
||||
use codex_rollout::EventPersistenceMode;
|
||||
use codex_rollout::RolloutConfig;
|
||||
use codex_rollout::RolloutRecorder;
|
||||
use codex_rollout::RolloutRecorderParams;
|
||||
use codex_rollout::build_thread_metadata_builder;
|
||||
@@ -550,9 +540,13 @@ impl Codex {
|
||||
};
|
||||
match thread_id {
|
||||
Some(thread_id) => {
|
||||
let state_db_ctx = state_db::get_state_db(&config).await;
|
||||
state_db::get_dynamic_tools(state_db_ctx.as_deref(), thread_id, "codex_spawn")
|
||||
.await
|
||||
let state_db_ctx = state_runtime::get_state_db(&config).await;
|
||||
state_runtime::get_dynamic_tools(
|
||||
state_db_ctx.as_deref(),
|
||||
thread_id,
|
||||
"codex_spawn",
|
||||
)
|
||||
.await
|
||||
}
|
||||
None => None,
|
||||
}
|
||||
@@ -738,7 +732,7 @@ impl Codex {
|
||||
state.session_configuration.thread_config_snapshot()
|
||||
}
|
||||
|
||||
pub(crate) fn state_db(&self) -> Option<state_db::StateDbHandle> {
|
||||
pub(crate) fn state_db(&self) -> Option<state_runtime::StateDbHandle> {
|
||||
self.session.state_db()
|
||||
}
|
||||
|
||||
@@ -1473,7 +1467,7 @@ impl Session {
|
||||
),
|
||||
InitialHistory::New | InitialHistory::Forked(_) => None,
|
||||
};
|
||||
let rollout_config = rollout_config(&config, session_configuration.cwd.clone());
|
||||
let rollout_config = rollout_config_with_cwd(&config, session_configuration.cwd.clone());
|
||||
|
||||
// Kick off independent async setup tasks in parallel to reduce startup latency.
|
||||
//
|
||||
@@ -1484,7 +1478,7 @@ impl Session {
|
||||
if config.ephemeral {
|
||||
Ok::<_, anyhow::Error>((None, None))
|
||||
} else {
|
||||
let state_db_ctx = state_db::init(&config).await;
|
||||
let state_db_ctx = state_runtime::init(&config).await;
|
||||
spawn_backfill_if_needed(state_db_ctx.clone(), &rollout_config).await;
|
||||
let rollout_recorder = RolloutRecorder::new(
|
||||
&rollout_config,
|
||||
@@ -2019,7 +2013,7 @@ impl Session {
|
||||
self.tx_event.clone()
|
||||
}
|
||||
|
||||
pub(crate) fn state_db(&self) -> Option<state_db::StateDbHandle> {
|
||||
pub(crate) fn state_db(&self) -> Option<state_runtime::StateDbHandle> {
|
||||
self.services.state_db.clone()
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,6 @@ use codex_protocol::protocol::RealtimeAudioFrame;
|
||||
use codex_protocol::protocol::Submission;
|
||||
use codex_protocol::protocol::W3cTraceContext;
|
||||
use codex_rollout::EventPersistenceMode;
|
||||
use codex_rollout::RolloutConfig;
|
||||
use codex_rollout::RolloutRecorder;
|
||||
use codex_rollout::RolloutRecorderParams;
|
||||
use core_test_support::tracing::install_test_tracing;
|
||||
@@ -83,17 +82,8 @@ use std::time::Duration;
|
||||
use tokio::time::sleep;
|
||||
use tracing_opentelemetry::OpenTelemetrySpanExt;
|
||||
|
||||
use crate::rollout_config;
|
||||
use codex_protocol::mcp::CallToolResult as McpCallToolResult;
|
||||
|
||||
fn rollout_config(config: &Config) -> RolloutConfig {
|
||||
RolloutConfig::new(
|
||||
config.codex_home.clone(),
|
||||
config.sqlite_home.clone(),
|
||||
config.cwd.clone(),
|
||||
config.model_provider_id.clone(),
|
||||
config.memories.generate_memories,
|
||||
)
|
||||
}
|
||||
use pretty_assertions::assert_eq;
|
||||
use rmcp::model::JsonObject;
|
||||
use rmcp::model::Tool;
|
||||
|
||||
@@ -26,7 +26,7 @@ use std::path::PathBuf;
|
||||
use tokio::sync::Mutex;
|
||||
use tokio::sync::watch;
|
||||
|
||||
use crate::state_db::StateDbHandle;
|
||||
use crate::state_runtime::StateDbHandle;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct ThreadConfigSnapshot {
|
||||
|
||||
@@ -68,6 +68,7 @@ mod model_provider_info;
|
||||
pub mod path_utils;
|
||||
pub mod personality_migration;
|
||||
pub mod plugins;
|
||||
mod rollout_config_builder;
|
||||
mod sandbox_tags;
|
||||
pub mod sandboxing;
|
||||
mod session_prefix;
|
||||
@@ -128,7 +129,7 @@ pub mod shell_snapshot;
|
||||
pub mod skills;
|
||||
pub mod spawn;
|
||||
mod state;
|
||||
pub mod state_db;
|
||||
pub mod state_runtime;
|
||||
mod tasks;
|
||||
mod tools;
|
||||
pub mod turn_diff_tracker;
|
||||
@@ -157,6 +158,8 @@ pub use exec_policy::check_execpolicy_for_warnings;
|
||||
pub use exec_policy::format_exec_policy_error_with_source;
|
||||
pub use exec_policy::load_exec_policy;
|
||||
pub use file_watcher::FileWatcherEvent;
|
||||
pub use rollout_config_builder::rollout_config;
|
||||
pub use rollout_config_builder::rollout_config_with_cwd;
|
||||
pub use safety::get_platform_sandbox;
|
||||
pub use tools::spec::parse_tool_input_schema;
|
||||
pub use turn_metadata::build_turn_metadata_header;
|
||||
|
||||
@@ -31,7 +31,7 @@ use crate::protocol::EventMsg;
|
||||
use crate::protocol::McpInvocation;
|
||||
use crate::protocol::McpToolCallBeginEvent;
|
||||
use crate::protocol::McpToolCallEndEvent;
|
||||
use crate::state_db;
|
||||
use crate::state_runtime;
|
||||
use codex_features::Feature;
|
||||
use codex_protocol::mcp::CallToolResult;
|
||||
use codex_protocol::openai_models::InputModality;
|
||||
@@ -281,7 +281,7 @@ async fn maybe_mark_thread_memory_mode_polluted(sess: &Session, turn_context: &T
|
||||
{
|
||||
return;
|
||||
}
|
||||
state_db::mark_thread_memory_mode_polluted(
|
||||
state_runtime::mark_thread_memory_mode_polluted(
|
||||
sess.services.state_db.as_deref(),
|
||||
sess.conversation_id,
|
||||
"mcp_tool_call",
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
use crate::config::Config;
|
||||
use codex_rollout::RolloutConfig;
|
||||
|
||||
pub fn rollout_config(config: &Config) -> RolloutConfig {
|
||||
rollout_config_with_cwd(config, config.cwd.clone())
|
||||
}
|
||||
|
||||
pub fn rollout_config_with_cwd(config: &Config, cwd: PathBuf) -> RolloutConfig {
|
||||
RolloutConfig::new(
|
||||
config.codex_home.clone(),
|
||||
config.sqlite_home.clone(),
|
||||
cwd,
|
||||
config.model_provider_id.clone(),
|
||||
config.memories.generate_memories,
|
||||
)
|
||||
}
|
||||
@@ -13,7 +13,7 @@ use crate::mcp_connection_manager::McpConnectionManager;
|
||||
use crate::models_manager::manager::ModelsManager;
|
||||
use crate::plugins::PluginsManager;
|
||||
use crate::skills::SkillsManager;
|
||||
use crate::state_db::StateDbHandle;
|
||||
use crate::state_runtime::StateDbHandle;
|
||||
use crate::tools::code_mode::CodeModeService;
|
||||
use crate::tools::network_approval::NetworkApprovalService;
|
||||
use crate::tools::runtimes::ExecveSessionApproval;
|
||||
|
||||
@@ -18,7 +18,7 @@ use crate::function_tool::FunctionCallError;
|
||||
use crate::memories::citations::get_thread_id_from_citations;
|
||||
use crate::memories::citations::parse_memory_citation;
|
||||
use crate::parse_turn_item;
|
||||
use crate::state_db;
|
||||
use crate::state_runtime;
|
||||
use crate::tools::parallel::ToolCallRuntime;
|
||||
use crate::tools::router::ToolRouter;
|
||||
use codex_protocol::models::DeveloperInstructions;
|
||||
@@ -146,7 +146,7 @@ async fn maybe_mark_thread_memory_mode_polluted_from_web_search(
|
||||
{
|
||||
return;
|
||||
}
|
||||
state_db::mark_thread_memory_mode_polluted(
|
||||
state_runtime::mark_thread_memory_mode_polluted(
|
||||
sess.services.state_db.as_deref(),
|
||||
sess.conversation_id,
|
||||
"record_completed_response_item",
|
||||
@@ -168,7 +168,7 @@ async fn record_stage1_output_usage_for_completed_item(
|
||||
return;
|
||||
}
|
||||
|
||||
if let Some(db) = state_db::get_state_db(turn_context.config.as_ref()).await {
|
||||
if let Some(db) = state_runtime::get_state_db(turn_context.config.as_ref()).await {
|
||||
let _ = db.record_stage1_output_usage(&thread_ids).await;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,11 +5,11 @@ use std::path::PathBuf;
|
||||
|
||||
use chrono::Utc;
|
||||
use codex_core::config::ConfigBuilder;
|
||||
use codex_core::rollout_config;
|
||||
use codex_protocol::ThreadId;
|
||||
use codex_protocol::models::BaseInstructions;
|
||||
use codex_protocol::protocol::SessionSource;
|
||||
use codex_rollout::EventPersistenceMode;
|
||||
use codex_rollout::RolloutConfig;
|
||||
use codex_rollout::RolloutRecorder;
|
||||
use codex_rollout::RolloutRecorderParams;
|
||||
use codex_rollout::find_archived_thread_path_by_id_str;
|
||||
@@ -51,16 +51,6 @@ fn write_minimal_rollout_with_id_in_subdir(codex_home: &Path, subdir: &str, id:
|
||||
file
|
||||
}
|
||||
|
||||
fn rollout_config(config: &codex_core::config::Config) -> RolloutConfig {
|
||||
RolloutConfig::new(
|
||||
config.codex_home.clone(),
|
||||
config.sqlite_home.clone(),
|
||||
config.cwd.clone(),
|
||||
config.model_provider_id.clone(),
|
||||
config.memories.generate_memories,
|
||||
)
|
||||
}
|
||||
|
||||
/// Create sessions/YYYY/MM/DD and write a minimal rollout file containing the
|
||||
/// provided conversation id in the SessionMeta line. Returns the absolute path.
|
||||
fn write_minimal_rollout_with_id(codex_home: &Path, id: Uuid) -> PathBuf {
|
||||
|
||||
@@ -59,7 +59,8 @@ use codex_core::config_loader::LoaderOverrides;
|
||||
use codex_core::config_loader::format_config_error_with_source;
|
||||
use codex_core::format_exec_policy_error_with_source;
|
||||
use codex_core::git_info::get_git_repo_root;
|
||||
use codex_core::state_db::get_state_db;
|
||||
use codex_core::rollout_config;
|
||||
use codex_core::state_runtime::get_state_db;
|
||||
use codex_feedback::CodexFeedback;
|
||||
use codex_otel::set_parent_from_context;
|
||||
use codex_otel::traceparent_context_from_env;
|
||||
@@ -73,7 +74,6 @@ use codex_protocol::protocol::ReviewTarget;
|
||||
use codex_protocol::protocol::SessionConfiguredEvent;
|
||||
use codex_protocol::protocol::SessionSource;
|
||||
use codex_protocol::user_input::UserInput;
|
||||
use codex_rollout::RolloutConfig;
|
||||
use codex_rollout::RolloutRecorder;
|
||||
use codex_rollout::ThreadSortKey;
|
||||
use codex_rollout::find_thread_path_by_id_str;
|
||||
@@ -163,16 +163,6 @@ fn exec_root_span() -> tracing::Span {
|
||||
)
|
||||
}
|
||||
|
||||
fn rollout_config(config: &Config) -> RolloutConfig {
|
||||
RolloutConfig::new(
|
||||
config.codex_home.clone(),
|
||||
config.sqlite_home.clone(),
|
||||
config.cwd.clone(),
|
||||
config.model_provider_id.clone(),
|
||||
config.memories.generate_memories,
|
||||
)
|
||||
}
|
||||
|
||||
pub async fn run_main(cli: Cli, arg0_paths: Arg0DispatchPaths) -> anyhow::Result<()> {
|
||||
if let Err(err) = set_default_originator("codex_exec".to_string()) {
|
||||
tracing::warn!(?err, "Failed to set codex exec originator override {err:?}");
|
||||
|
||||
@@ -20,6 +20,8 @@ pub mod recorder;
|
||||
pub mod session_index;
|
||||
mod state_db;
|
||||
#[cfg(test)]
|
||||
mod test_support;
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
pub use list::Cursor;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use super::*;
|
||||
use crate::RolloutConfig;
|
||||
use crate::test_support::test_rollout_config;
|
||||
use chrono::DateTime;
|
||||
use chrono::NaiveDateTime;
|
||||
use chrono::Timelike;
|
||||
@@ -17,21 +17,10 @@ use codex_state::ThreadMetadataBuilder;
|
||||
use pretty_assertions::assert_eq;
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
use std::path::Path;
|
||||
use std::path::PathBuf;
|
||||
use tempfile::tempdir;
|
||||
use uuid::Uuid;
|
||||
|
||||
fn test_rollout_config(codex_home: &Path) -> RolloutConfig {
|
||||
RolloutConfig::new(
|
||||
codex_home.to_path_buf(),
|
||||
codex_home.to_path_buf(),
|
||||
codex_home.to_path_buf(),
|
||||
"test-provider".to_string(),
|
||||
false,
|
||||
)
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn extract_metadata_from_rollout_uses_session_meta() {
|
||||
let dir = tempdir().expect("tempdir");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use super::*;
|
||||
use crate::RolloutConfig;
|
||||
use crate::test_support::test_rollout_config;
|
||||
use chrono::TimeZone;
|
||||
use codex_protocol::config_types::ReasoningSummary as ReasoningSummaryConfig;
|
||||
use codex_protocol::protocol::AgentMessageEvent;
|
||||
@@ -18,16 +18,6 @@ use std::time::Duration;
|
||||
use tempfile::TempDir;
|
||||
use uuid::Uuid;
|
||||
|
||||
fn test_rollout_config(codex_home: &Path) -> RolloutConfig {
|
||||
RolloutConfig::new(
|
||||
codex_home.to_path_buf(),
|
||||
codex_home.to_path_buf(),
|
||||
codex_home.to_path_buf(),
|
||||
"test-provider".to_string(),
|
||||
false,
|
||||
)
|
||||
}
|
||||
|
||||
fn write_session_file(root: &Path, ts: &str, uuid: Uuid) -> std::io::Result<PathBuf> {
|
||||
let day_dir = root.join("sessions/2025/01/03");
|
||||
fs::create_dir_all(&day_dir)?;
|
||||
|
||||
@@ -446,3 +446,7 @@ pub(crate) async fn touch_thread_updated_at(
|
||||
false
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "state_db_tests.rs"]
|
||||
mod tests;
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
use super::*;
|
||||
use codex_rollout::parse_cursor;
|
||||
use crate::parse_cursor;
|
||||
use chrono::DateTime;
|
||||
use chrono::NaiveDateTime;
|
||||
use chrono::Timelike;
|
||||
use chrono::Utc;
|
||||
use pretty_assertions::assert_eq;
|
||||
use uuid::Uuid;
|
||||
|
||||
#[test]
|
||||
fn cursor_to_anchor_normalizes_timestamp_format() {
|
||||
@@ -0,0 +1,13 @@
|
||||
use std::path::Path;
|
||||
|
||||
use crate::RolloutConfig;
|
||||
|
||||
pub(crate) fn test_rollout_config(codex_home: &Path) -> RolloutConfig {
|
||||
RolloutConfig::new(
|
||||
codex_home.to_path_buf(),
|
||||
codex_home.to_path_buf(),
|
||||
codex_home.to_path_buf(),
|
||||
"test-provider".to_string(),
|
||||
false,
|
||||
)
|
||||
}
|
||||
+3
-13
@@ -27,7 +27,8 @@ use codex_core::config_loader::format_config_error_with_source;
|
||||
use codex_core::default_client::set_default_client_residency_requirement;
|
||||
use codex_core::format_exec_policy_error_with_source;
|
||||
use codex_core::path_utils;
|
||||
use codex_core::state_db::get_state_db;
|
||||
use codex_core::rollout_config;
|
||||
use codex_core::state_runtime::get_state_db;
|
||||
use codex_core::windows_sandbox::WindowsSandboxLevelExt;
|
||||
use codex_protocol::ThreadId;
|
||||
use codex_protocol::config_types::AltScreenMode;
|
||||
@@ -37,7 +38,6 @@ use codex_protocol::protocol::AskForApproval;
|
||||
use codex_protocol::protocol::RolloutItem;
|
||||
use codex_protocol::protocol::RolloutLine;
|
||||
use codex_rollout::INTERACTIVE_SESSION_SOURCES;
|
||||
use codex_rollout::RolloutConfig;
|
||||
use codex_rollout::RolloutRecorder;
|
||||
use codex_rollout::ThreadSortKey;
|
||||
use codex_rollout::find_thread_path_by_id_str;
|
||||
@@ -264,16 +264,6 @@ pub use public_widgets::composer_input::ComposerAction;
|
||||
pub use public_widgets::composer_input::ComposerInput;
|
||||
// (tests access modules directly within the crate)
|
||||
|
||||
fn rollout_config(config: &Config) -> RolloutConfig {
|
||||
RolloutConfig::new(
|
||||
config.codex_home.clone(),
|
||||
config.sqlite_home.clone(),
|
||||
config.cwd.clone(),
|
||||
config.model_provider_id.clone(),
|
||||
config.memories.generate_memories,
|
||||
)
|
||||
}
|
||||
|
||||
pub async fn run_main(
|
||||
mut cli: Cli,
|
||||
arg0_paths: Arg0DispatchPaths,
|
||||
@@ -565,7 +555,7 @@ pub async fn run_main(
|
||||
|
||||
let otel_tracing_layer = otel.as_ref().and_then(|o| o.tracing_layer());
|
||||
|
||||
let log_db_layer = codex_core::state_db::get_state_db(&config)
|
||||
let log_db_layer = get_state_db(&config)
|
||||
.await
|
||||
.map(|db| log_db::start(db).with_filter(env_filter()));
|
||||
|
||||
|
||||
@@ -14,11 +14,11 @@ use chrono::DateTime;
|
||||
use chrono::Utc;
|
||||
use codex_core::config::Config;
|
||||
use codex_core::path_utils;
|
||||
use codex_core::state_db::get_state_db;
|
||||
use codex_core::rollout_config;
|
||||
use codex_core::state_runtime::get_state_db;
|
||||
use codex_protocol::ThreadId;
|
||||
use codex_rollout::Cursor;
|
||||
use codex_rollout::INTERACTIVE_SESSION_SOURCES;
|
||||
use codex_rollout::RolloutConfig;
|
||||
use codex_rollout::RolloutRecorder;
|
||||
use codex_rollout::ThreadItem;
|
||||
use codex_rollout::ThreadSortKey;
|
||||
@@ -97,16 +97,6 @@ struct PageLoadRequest {
|
||||
|
||||
type PageLoader = Arc<dyn Fn(PageLoadRequest) + Send + Sync>;
|
||||
|
||||
fn rollout_config(config: &Config) -> RolloutConfig {
|
||||
RolloutConfig::new(
|
||||
config.codex_home.clone(),
|
||||
config.sqlite_home.clone(),
|
||||
config.cwd.clone(),
|
||||
config.model_provider_id.clone(),
|
||||
config.memories.generate_memories,
|
||||
)
|
||||
}
|
||||
|
||||
enum BackgroundEvent {
|
||||
PageLoaded {
|
||||
request_token: usize,
|
||||
|
||||
@@ -37,7 +37,7 @@ use codex_core::config_loader::format_config_error_with_source;
|
||||
use codex_core::default_client::set_default_client_residency_requirement;
|
||||
use codex_core::format_exec_policy_error_with_source;
|
||||
use codex_core::path_utils;
|
||||
use codex_core::state_db::get_state_db;
|
||||
use codex_core::state_runtime::get_state_db;
|
||||
use codex_core::windows_sandbox::WindowsSandboxLevelExt;
|
||||
use codex_protocol::ThreadId;
|
||||
use codex_protocol::config_types::AltScreenMode;
|
||||
@@ -878,7 +878,7 @@ pub async fn run_main(
|
||||
|
||||
let otel_tracing_layer = otel.as_ref().and_then(|o| o.tracing_layer());
|
||||
|
||||
let log_db_layer = codex_core::state_db::get_state_db(&config)
|
||||
let log_db_layer = get_state_db(&config)
|
||||
.await
|
||||
.map(|db| log_db::start(db).with_filter(env_filter()));
|
||||
|
||||
|
||||
@@ -19,11 +19,11 @@ use codex_app_server_protocol::ThreadSortKey as AppServerThreadSortKey;
|
||||
use codex_app_server_protocol::ThreadSourceKind;
|
||||
use codex_core::config::Config;
|
||||
use codex_core::path_utils;
|
||||
use codex_core::state_db::get_state_db;
|
||||
use codex_core::rollout_config;
|
||||
use codex_core::state_runtime::get_state_db;
|
||||
use codex_protocol::ThreadId;
|
||||
use codex_rollout::Cursor;
|
||||
use codex_rollout::INTERACTIVE_SESSION_SOURCES;
|
||||
use codex_rollout::RolloutConfig;
|
||||
use codex_rollout::RolloutRecorder;
|
||||
use codex_rollout::ThreadItem;
|
||||
use codex_rollout::ThreadSortKey;
|
||||
@@ -118,16 +118,6 @@ enum ProviderFilter {
|
||||
|
||||
type PageLoader = Arc<dyn Fn(PageLoadRequest) + Send + Sync>;
|
||||
|
||||
fn rollout_config(config: &Config) -> RolloutConfig {
|
||||
RolloutConfig::new(
|
||||
config.codex_home.clone(),
|
||||
config.sqlite_home.clone(),
|
||||
config.cwd.clone(),
|
||||
config.model_provider_id.clone(),
|
||||
config.memories.generate_memories,
|
||||
)
|
||||
}
|
||||
|
||||
enum BackgroundEvent {
|
||||
PageLoaded {
|
||||
request_token: usize,
|
||||
|
||||
Reference in New Issue
Block a user