Add non-interactive resume filter option (#15339)

## Summary
- add `codex resume --include-non-interactive` to include
non-interactive sessions in the picker and `--last`
- keep current-provider and cwd filtering behavior unchanged
- replace the picker API boolean with a `SessionSourceFilter` enum to
avoid a boolean trap

## Tests
- `cargo test -p codex-cli`
- `cargo test -p codex-tui`
- `just fmt`
- `just fix -p codex-cli`
- `just fix -p codex-tui`
This commit is contained in:
Jeremy Rose
2026-03-25 11:05:07 -07:00
committed by GitHub
parent fba3c79885
commit 6b10e186c4
5 changed files with 81 additions and 7 deletions

View File

@@ -845,12 +845,17 @@ async fn run_ratatui_app(
} else {
Some(config.cwd.as_path())
};
let allowed_sources = if cli.resume_include_non_interactive {
&[][..]
} else {
INTERACTIVE_SESSION_SOURCES.as_slice()
};
match RolloutRecorder::find_latest_thread_path(
&config,
/*page_size*/ 1,
/*cursor*/ None,
ThreadSortKey::UpdatedAt,
INTERACTIVE_SESSION_SOURCES.as_slice(),
allowed_sources,
Some(provider_filter.as_slice()),
&config.model_provider_id,
filter_cwd,
@@ -888,7 +893,19 @@ async fn run_ratatui_app(
_ => resume_picker::SessionSelection::StartFresh,
}
} else if cli.resume_picker {
match resume_picker::run_resume_picker(&mut tui, &config, cli.resume_show_all).await? {
let source_filter = if cli.resume_include_non_interactive {
resume_picker::SessionSourceFilter::IncludeNonInteractive
} else {
resume_picker::SessionSourceFilter::InteractiveOnly
};
match resume_picker::run_resume_picker(
&mut tui,
&config,
cli.resume_show_all,
source_filter,
)
.await?
{
resume_picker::SessionSelection::Exit => {
terminal_restore_guard.restore_silently();
session_log::log_session_end();