mirror of
https://github.com/openai/codex.git
synced 2026-11-20 22:40:37 +00:00
Clarify exact-name thread search mode
This commit is contained in:
+2
-2
@@ -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"
|
||||
},
|
||||
|
||||
+2
-2
@@ -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"
|
||||
},
|
||||
|
||||
+2
-2
@@ -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"
|
||||
},
|
||||
|
||||
@@ -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.",
|
||||
|
||||
@@ -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, };
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -4325,7 +4325,7 @@ pub struct ThreadListParams {
|
||||
/// Optional substring filter for the extracted thread title.
|
||||
#[ts(optional = nullable)]
|
||||
pub search_term: Option<String>,
|
||||
/// Optional search matching mode. Defaults to substring matching.
|
||||
/// Optional search matching mode. Defaults to substring title matching.
|
||||
#[ts(optional = nullable)]
|
||||
pub search_mode: Option<ThreadListSearchMode>,
|
||||
}
|
||||
@@ -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::<ThreadListParams>(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]
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user