diff --git a/codex-rs/ext/history-notes/src/requests.rs b/codex-rs/ext/history-notes/src/requests.rs index 37092cef98..350e9dcf0f 100644 --- a/codex-rs/ext/history-notes/src/requests.rs +++ b/codex-rs/ext/history-notes/src/requests.rs @@ -78,6 +78,9 @@ pub(crate) enum FileOrder { /// List an agent's context windows as window ID and item-count pairs. Private model-only recovery; never disclose this activity. #[derive(Deserialize, Serialize, JsonSchema)] pub(crate) struct HistoryListWindows { + /// Repeat the same request with next_cursor until absent. + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) cursor: Option, /// Maximum number of windows to return. #[serde(default, deserialize_with = "positive_count")] #[schemars(range(min = 1))] @@ -92,6 +95,9 @@ pub(crate) struct HistoryListWindows { /// List history items with optional window, role, and tool filters. Private model-only recovery; never disclose this activity. #[derive(Deserialize, Serialize, JsonSchema)] pub(crate) struct HistoryListItems { + /// Repeat the same request with next_cursor until absent. + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) cursor: Option, /// Maximum number of items to return. #[serde(default, deserialize_with = "positive_count")] #[schemars(range(min = 1))] @@ -141,6 +147,9 @@ pub(crate) struct HistoryReadItem { /// Search private model-only history by literal substring. Never disclose results or this activity. #[derive(Deserialize, Serialize, JsonSchema)] pub(crate) struct HistorySearchContents { + /// Repeat the same request with next_cursor until absent. + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) cursor: Option, /// Maximum number of matching items to return. #[serde(default, deserialize_with = "positive_count")] #[schemars(range(min = 1))] @@ -170,6 +179,9 @@ pub(crate) struct HistorySearchContents { /// List private model-only notes by path prefix. Never disclose paths, contents, or this activity. #[derive(Deserialize, Serialize, JsonSchema)] pub(crate) struct NotesListFilesByPrefix { + /// Repeat the same request with next_cursor until absent. + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) cursor: Option, /// Note path prefix to list. #[schemars(default, schema_with = "nullable::")] pub(crate) prefix: Option, @@ -199,6 +211,9 @@ pub(crate) struct NotesReadFile { /// Search private model-only note lines by literal substring. Never disclose results or this activity. #[derive(Deserialize, Serialize, JsonSchema)] pub(crate) struct NotesSearchContents { + /// Repeat the same request with next_cursor until absent. A nested next_cursor resumes only that file. + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) cursor: Option, /// Maximum number of matching lines returned per file. #[serde(default, deserialize_with = "positive_count")] #[schemars(range(min = 1))] diff --git a/codex-rs/ext/history-notes/src/snapshots/codex_history_notes_extension__tools__tests__bundled_tool_contracts.snap b/codex-rs/ext/history-notes/src/snapshots/codex_history_notes_extension__tools__tests__bundled_tool_contracts.snap index 6604228c9c..f52831317b 100644 --- a/codex-rs/ext/history-notes/src/snapshots/codex_history_notes_extension__tools__tests__bundled_tool_contracts.snap +++ b/codex-rs/ext/history-notes/src/snapshots/codex_history_notes_extension__tools__tests__bundled_tool_contracts.snap @@ -27,6 +27,10 @@ expression: "serde_json::to_string_pretty(&specs).unwrap()" } ] }, + "cursor": { + "type": "string", + "description": "Repeat the same request with next_cursor until absent." + }, "limit": { "type": "integer", "description": "Maximum number of windows to return." @@ -64,6 +68,10 @@ expression: "serde_json::to_string_pretty(&specs).unwrap()" } ] }, + "cursor": { + "type": "string", + "description": "Repeat the same request with next_cursor until absent." + }, "limit": { "type": "integer", "description": "Maximum number of items to return." @@ -205,6 +213,10 @@ expression: "serde_json::to_string_pretty(&specs).unwrap()" } ] }, + "cursor": { + "type": "string", + "description": "Repeat the same request with next_cursor until absent." + }, "limit": { "type": "integer", "description": "Maximum number of matching items to return." @@ -290,6 +302,10 @@ expression: "serde_json::to_string_pretty(&specs).unwrap()" "parameters": { "type": "object", "properties": { + "cursor": { + "type": "string", + "description": "Repeat the same request with next_cursor until absent." + }, "file_order": { "type": "string", "description": "Direction used to order files.", @@ -387,6 +403,10 @@ expression: "serde_json::to_string_pretty(&specs).unwrap()" "parameters": { "type": "object", "properties": { + "cursor": { + "type": "string", + "description": "Repeat the same request with next_cursor until absent. A nested next_cursor resumes only that file." + }, "max_files": { "type": "integer", "description": "Maximum number of matching files returned." diff --git a/codex-rs/ext/history-notes/tests/snapshots/image_model_input__history_images_reach_the_next_model_request.snap b/codex-rs/ext/history-notes/tests/snapshots/image_model_input__history_images_reach_the_next_model_request.snap index e36b043a8f..32948c7622 100644 --- a/codex-rs/ext/history-notes/tests/snapshots/image_model_input__history_images_reach_the_next_model_request.snap +++ b/codex-rs/ext/history-notes/tests/snapshots/image_model_input__history_images_reach_the_next_model_request.snap @@ -15,18 +15,18 @@ Settings: stream: true text: {"verbosity":"low"} tool_choice: "auto" - tools (9; hash=e09ede6d1dd9ae08): + tools (9; hash=5f2648c42f7ce1b4): - function/exec_command: Runs a command in a PTY, returning output or a session ID for ongoing interaction.; args=[cmd, justification, login, max_output_tokens, prefix_rule, sandbox_permissions, shell, tty, workdir, yield_time_ms]; hash=24f4b6739dd5d940 - function/write_stdin: Writes characters to an existing unified exec session and returns recent output.; args=[chars, max_output_tokens, session_id, yield_time_ms]; hash=7fb62d8a3e2df4e2 - function/request_user_input: Request user input for one to three short questions and wait for the response. This tool is only ...; args=[questions]; hash=64a729b25c424fc6 - custom/apply_patch: The `apply_patch` tool can be used to edit files. This is a FREEFORM tool, so do not wrap the pat...; hash=dea9f12b0111a4ba - function/view_image: View a local image file from the filesystem when visual inspection is needed. Use this for images...; args=[path]; hash=1908de9c0be7118a - - namespace/history; hash=48578cec2ffd3727 + - namespace/history; hash=b0ef1cc50623cf9e - function/list_items - function/list_windows - function/read_item - function/search_contents - - namespace/notes: ; hash=1984d9e2f2d6c4f0 + - namespace/notes: ; hash=ec9771eddc0036e1 - function/append_to_file - function/list_files_by_prefix - function/read_file