diff --git a/codex-rs/app-server-protocol/schema/json/ClientRequest.json b/codex-rs/app-server-protocol/schema/json/ClientRequest.json index 205cb5afc0..120aaa2e2a 100644 --- a/codex-rs/app-server-protocol/schema/json/ClientRequest.json +++ b/codex-rs/app-server-protocol/schema/json/ClientRequest.json @@ -3637,7 +3637,7 @@ "type": "null" } ], - "description": "Optional search matching mode. Defaults to substring matching." + "description": "Optional search matching mode. Defaults to substring title matching." }, "searchTerm": { "description": "Optional substring filter for the extracted thread title.", @@ -3688,7 +3688,7 @@ "ThreadListSearchMode": { "enum": [ "contains", - "exact" + "exactName" ], "type": "string" }, diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json index 11b5a79161..2ac4ead80c 100644 --- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json +++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json @@ -16132,7 +16132,7 @@ "type": "null" } ], - "description": "Optional search matching mode. Defaults to substring matching." + "description": "Optional search matching mode. Defaults to substring title matching." }, "searchTerm": { "description": "Optional substring filter for the extracted thread title.", @@ -16214,7 +16214,7 @@ "ThreadListSearchMode": { "enum": [ "contains", - "exact" + "exactName" ], "type": "string" }, diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json index 3f99a2c962..b08698d58f 100644 --- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json +++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json @@ -14018,7 +14018,7 @@ "type": "null" } ], - "description": "Optional search matching mode. Defaults to substring matching." + "description": "Optional search matching mode. Defaults to substring title matching." }, "searchTerm": { "description": "Optional substring filter for the extracted thread title.", @@ -14100,7 +14100,7 @@ "ThreadListSearchMode": { "enum": [ "contains", - "exact" + "exactName" ], "type": "string" }, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadListParams.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadListParams.json index 8611651f61..70a5a25da6 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadListParams.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadListParams.json @@ -24,7 +24,7 @@ "ThreadListSearchMode": { "enum": [ "contains", - "exact" + "exactName" ], "type": "string" }, @@ -105,7 +105,7 @@ "type": "null" } ], - "description": "Optional search matching mode. Defaults to substring matching." + "description": "Optional search matching mode. Defaults to substring title matching." }, "searchTerm": { "description": "Optional substring filter for the extracted thread title.", diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadListParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadListParams.ts index 74494e0120..30e974b270 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadListParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadListParams.ts @@ -54,6 +54,6 @@ useStateDbOnly?: boolean, */ searchTerm?: string | null, /** - * Optional search matching mode. Defaults to substring matching. + * Optional search matching mode. Defaults to substring title matching. */ searchMode?: ThreadListSearchMode | null, }; diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadListSearchMode.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadListSearchMode.ts index 814caf5805..4f22a54085 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadListSearchMode.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadListSearchMode.ts @@ -2,4 +2,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type ThreadListSearchMode = "contains" | "exact"; +export type ThreadListSearchMode = "contains" | "exactName"; diff --git a/codex-rs/app-server-protocol/src/protocol/v2.rs b/codex-rs/app-server-protocol/src/protocol/v2.rs index ac74169b9e..711e0fe1ab 100644 --- a/codex-rs/app-server-protocol/src/protocol/v2.rs +++ b/codex-rs/app-server-protocol/src/protocol/v2.rs @@ -4325,7 +4325,7 @@ pub struct ThreadListParams { /// Optional substring filter for the extracted thread title. #[ts(optional = nullable)] pub search_term: Option, - /// Optional search matching mode. Defaults to substring matching. + /// Optional search matching mode. Defaults to substring title matching. #[ts(optional = nullable)] pub search_mode: Option, } @@ -4342,7 +4342,7 @@ pub enum ThreadListCwdFilter { #[ts(rename_all = "camelCase", export_to = "v2/")] pub enum ThreadListSearchMode { Contains, - Exact, + ExactName, } #[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)] @@ -8245,12 +8245,12 @@ mod tests { fn thread_list_params_accepts_state_db_only_flag() { let params = serde_json::from_value::(json!({ "useStateDbOnly": true, - "searchMode": "exact", + "searchMode": "exactName", })) .expect("state db only flag should deserialize"); assert!(params.use_state_db_only); - assert_eq!(params.search_mode, Some(ThreadListSearchMode::Exact)); + assert_eq!(params.search_mode, Some(ThreadListSearchMode::ExactName)); } #[test] diff --git a/codex-rs/app-server/README.md b/codex-rs/app-server/README.md index d3d139b25f..410dabd7e4 100644 --- a/codex-rs/app-server/README.md +++ b/codex-rs/app-server/README.md @@ -321,7 +321,7 @@ Like `thread/resume`, experimental clients can pass `excludeTurns: true` to `thr - `cwd` — restrict results to threads whose session cwd exactly matches this path, or one of these paths when an array is provided. Relative paths are resolved against the app-server process cwd before matching. - `useStateDbOnly` — when `true`, return from the state DB without scanning JSONL rollouts to repair metadata. Omit or pass `false` to preserve the default scan-and-repair behavior. - `searchTerm` — restrict results to threads whose extracted title contains this substring (case-sensitive). -- `searchMode` — optional search matching mode for `searchTerm`: `contains` (default) or `exact`. +- `searchMode` — optional search matching mode for `searchTerm`: `contains` (default) or `exactName` to narrow to exact user-facing thread names. - Responses include `nextCursor` to continue in the same direction and `backwardsCursor` to pass as `cursor` when reversing `sortDirection`. - Responses include `agentNickname` and `agentRole` for AgentControl-spawned thread sub-agents when available. diff --git a/codex-rs/app-server/src/request_processors/thread_processor.rs b/codex-rs/app-server/src/request_processors/thread_processor.rs index 8157d60faa..aa1a75b18f 100644 --- a/codex-rs/app-server/src/request_processors/thread_processor.rs +++ b/codex-rs/app-server/src/request_processors/thread_processor.rs @@ -3292,7 +3292,7 @@ impl ThreadRequestProcessor { }) }) && match (search_mode, search_term.as_deref()) { - (Some(ThreadListSearchMode::Exact), Some(search_term)) => { + (Some(ThreadListSearchMode::ExactName), Some(search_term)) => { it.name.as_deref() == Some(search_term) } _ => true, diff --git a/codex-rs/app-server/tests/suite/v2/thread_list.rs b/codex-rs/app-server/tests/suite/v2/thread_list.rs index ef2d0cbaa7..be686ef73e 100644 --- a/codex-rs/app-server/tests/suite/v2/thread_list.rs +++ b/codex-rs/app-server/tests/suite/v2/thread_list.rs @@ -693,7 +693,7 @@ sqlite = true cwd: None, use_state_db_only: false, search_term: Some("needle exact".to_string()), - search_mode: Some(ThreadListSearchMode::Exact), + search_mode: Some(ThreadListSearchMode::ExactName), }) .await?; let exact_resp: JSONRPCResponse = timeout( diff --git a/codex-rs/tui/src/lib.rs b/codex-rs/tui/src/lib.rs index 5e69957b5a..d60262356a 100644 --- a/codex-rs/tui/src/lib.rs +++ b/codex-rs/tui/src/lib.rs @@ -559,7 +559,7 @@ async fn lookup_session_target_by_name_with_app_server( cwd: None, use_state_db_only: false, search_term: Some(name.to_string()), - search_mode: Some(ThreadListSearchMode::Exact), + search_mode: Some(ThreadListSearchMode::ExactName), }) .await?; Ok(response