mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
Made codex exec resume --last consistent with codex resume --last (#9352)
PR #9245 made `codex resume --last` honor cwd, but I forgot to make the same change for `codex exec resume --last`. This PR fixes the inconsistency. This addresses #8700
This commit is contained in:
@@ -119,6 +119,10 @@ pub struct ResumeArgs {
|
||||
#[arg(long = "last", default_value_t = false)]
|
||||
pub last: bool,
|
||||
|
||||
/// Show all sessions (disables cwd filtering).
|
||||
#[arg(long = "all", default_value_t = false)]
|
||||
pub all: bool,
|
||||
|
||||
/// Optional image(s) to attach to the prompt sent after resuming.
|
||||
#[arg(
|
||||
long = "image",
|
||||
|
||||
@@ -507,17 +507,21 @@ async fn resolve_resume_path(
|
||||
) -> anyhow::Result<Option<PathBuf>> {
|
||||
if args.last {
|
||||
let default_provider_filter = vec![config.model_provider_id.clone()];
|
||||
match codex_core::RolloutRecorder::list_threads(
|
||||
let filter_cwd = if args.all {
|
||||
None
|
||||
} else {
|
||||
Some(config.cwd.as_path())
|
||||
};
|
||||
match codex_core::RolloutRecorder::find_latest_thread_path(
|
||||
&config.codex_home,
|
||||
1,
|
||||
None,
|
||||
&[],
|
||||
Some(default_provider_filter.as_slice()),
|
||||
&config.model_provider_id,
|
||||
filter_cwd,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Ok(page) => Ok(page.items.first().map(|it| it.path.clone())),
|
||||
Ok(path) => Ok(path),
|
||||
Err(e) => {
|
||||
error!("Error listing threads: {e}");
|
||||
Ok(None)
|
||||
|
||||
Reference in New Issue
Block a user