mirror of
https://github.com/openai/codex.git
synced 2026-05-02 04:11:39 +03:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user