mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Resolve session labels uniquely before acting on them (#43315)
## Why Selecting the first matching session name can target the wrong conversation when labels are duplicated. Session commands also need to accept preview text when no explicit name is set. ## What changed - Share app-server label lookup across resume, fork, archive, unarchive, delete, and queue commands, matching the trimmed name or fallback preview. - Reject distinct matching sessions across collections and source filters, and require a UUID when pagination prevents verifying uniqueness. - Revalidate listed candidates with `thread/read`, skip unusable local rollouts, and retain compatibility with older servers that cannot read unloaded threads. - Show ambiguous resume errors in the TUI without replacing the current conversation. - Disable implicit local daemon reuse with `--oss`. ## Testing Add regression coverage for name and preview lookup, provider filtering, duplicate labels across pages and collections, stale rollouts, older-server compatibility, queue ambiguity, and preserving the current conversation after an ambiguous resume. GitOrigin-RevId: e2766276a16140fb674c9640f7050c11ac0d0f6f
This commit is contained in:
1 parent
455318c202
commit
02d4529f55
11 files changed
+699
-772
No files matched your search
@@ -1,11 +1,9 @@
|
||||
//! Queue user messages through a local or remote app server.
|
||||
|
||||
use std::path::Path;
|
||||
|
||||
use crate::app_server_session::AppServerSession;
|
||||
use crate::named_session_lookup::SessionCollection;
|
||||
use crate::named_session_lookup::lookup;
|
||||
use crate::session_archive_commands::SessionArchiveCommandOptions;
|
||||
use crate::session_archive_commands::SessionNameMatch;
|
||||
use crate::session_archive_commands::lookup_session_by_exact_name;
|
||||
use crate::session_archive_commands::start_app_server_for_session_command;
|
||||
use codex_app_server_client::TypedRequestError;
|
||||
use codex_app_server_protocol::ClientRequest;
|
||||
@@ -19,6 +17,7 @@ use color_eyre::Report;
|
||||
use color_eyre::eyre::Result;
|
||||
use color_eyre::eyre::WrapErr;
|
||||
use color_eyre::eyre::eyre;
|
||||
use std::path::Path;
|
||||
use uuid::Uuid;
|
||||
|
||||
const JSONRPC_INVALID_REQUEST: i64 = -32600;
|
||||
@@ -87,12 +86,17 @@ pub(super) async fn run_session_queue_action_with_app_server(
|
||||
let thread_id = if let Ok(thread_id) = ThreadId::from_string(target) {
|
||||
thread_id
|
||||
} else {
|
||||
let thread = lookup_session_by_exact_name(
|
||||
let thread = lookup(
|
||||
app_server,
|
||||
codex_home,
|
||||
target,
|
||||
/*archived*/ false,
|
||||
SessionNameMatch::FirstIncludingNonInteractive,
|
||||
&[SessionCollection::Active],
|
||||
&[
|
||||
super::resume_source_kinds(/*include_non_interactive*/ true),
|
||||
// An empty filter includes Atlas/ChatGPT sessions.
|
||||
Vec::new(),
|
||||
],
|
||||
/*model_provider*/ None,
|
||||
)
|
||||
.await?
|
||||
.ok_or_else(|| eyre!("No active session found matching '{target}'."))?;
|
||||
|
||||
Reference in new issue
Block a user