mirror of
https://github.com/openai/codex.git
synced 2026-11-29 00:00:54 +00:00
simplify
This commit is contained in:
@@ -232,6 +232,7 @@ 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::read_head_for_summary;
|
||||
use codex_core::read_latest_turn_context;
|
||||
use codex_core::read_session_meta_line;
|
||||
use codex_core::rollout_date_parts;
|
||||
use codex_core::sandboxing::SandboxPermissions;
|
||||
@@ -8177,6 +8178,10 @@ async fn read_history_cwd_from_state_db(
|
||||
thread_id: Option<ThreadId>,
|
||||
rollout_path: &Path,
|
||||
) -> Option<PathBuf> {
|
||||
if let Ok(Some(turn_context)) = read_latest_turn_context(rollout_path).await {
|
||||
return Some(turn_context.cwd);
|
||||
}
|
||||
|
||||
if let Some(state_db_ctx) = get_state_db(config).await
|
||||
&& let Some(thread_id) = thread_id
|
||||
&& let Ok(Some(metadata)) = state_db_ctx.get_thread(thread_id).await
|
||||
@@ -8412,6 +8417,12 @@ pub(crate) async fn read_summary_from_rollout(
|
||||
.unwrap_or_else(|| fallback_provider.to_string());
|
||||
let git_info = git.as_ref().map(map_git_info);
|
||||
let updated_at = updated_at.or_else(|| timestamp.clone());
|
||||
let resume_cwd = read_latest_turn_context(path)
|
||||
.await
|
||||
.ok()
|
||||
.flatten()
|
||||
.map(|turn_context| turn_context.cwd)
|
||||
.unwrap_or_else(|| session_meta.cwd.clone());
|
||||
|
||||
Ok(ConversationSummary {
|
||||
conversation_id: session_meta.id,
|
||||
@@ -8420,7 +8431,7 @@ pub(crate) async fn read_summary_from_rollout(
|
||||
path: path.to_path_buf(),
|
||||
preview: String::new(),
|
||||
model_provider,
|
||||
cwd: session_meta.cwd,
|
||||
cwd: resume_cwd,
|
||||
cli_version: session_meta.cli_version,
|
||||
source: session_meta.source,
|
||||
git_info,
|
||||
|
||||
Reference in New Issue
Block a user