Repository navigation
fix(tools): read a placeholder search cursor as the first page - #197
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dccfa97af8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
lg2m
added a commit
that referenced
this pull request
Sep 26, 2026
…e schema digest (ENG-959) Review follow-ups on #197. The first-page placeholders are now a const slice compared with `eq_ignore_ascii_case`, so `START`, `First`, `NULL` read as no cursor the way `INITIAL` already did; no real cursor collides in any casing (base64url of `path\0line` is at least four alphabet characters decoding to a NUL). The tool-schema digest pinned by `built_in_tool_declarations_keep_their_order_and_schema_identity` moves with the new description text; CI on dccfa97 failed there. Docs: `tools.md` § Read-Side Walk describes the trimmed and placeholder cursor semantics; ledger T2.1 records the slice and the declined finding (pre-trim length check: arguments are already capped at 64 KiB in dispatch).
Of 1,485 search calls in one day's sessions, ~1,470 failed with cursor_invalid. Every one was a first call carrying a placeholder the model invented for "start from the beginning": "" (266), "initial", "start", "first", "0", ".", "/", "null". Four different models did it, the error text said what a valid cursor looks like rather than that the field should be omitted, and the models cycled through synonyms burning turns. One run looped on it for 1,091 turns until it overflowed its context window. None of these strings can be a real cursor (those are base64 of `path\0line` with a non-empty path), so `search` now reads them, and whitespace, as "no cursor". A genuinely malformed cursor still errors, and the message now leads with "omit `cursor` for the first page". The schema describes the field the same way. Regression: each placeholder returns byte-for-byte the same page as omitting the field; "!!" still fails with the new text.
…e schema digest (ENG-959) Review follow-ups on #197. The first-page placeholders are now a const slice compared with `eq_ignore_ascii_case`, so `START`, `First`, `NULL` read as no cursor the way `INITIAL` already did; no real cursor collides in any casing (base64url of `path\0line` is at least four alphabet characters decoding to a NUL). The tool-schema digest pinned by `built_in_tool_declarations_keep_their_order_and_schema_identity` moves with the new description text; CI on dccfa97 failed there. Docs: `tools.md` § Read-Side Walk describes the trimmed and placeholder cursor semantics; ledger T2.1 records the slice and the declined finding (pre-trim length check: arguments are already capped at 64 KiB in dispatch).
lg2m
force-pushed
the
fix/eng-959-search-cursor
branch
from
September 26, 2026 19:03
0df1aa6 to
2b5f73f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes ENG-959. Stacked on #196 → #195. Merge in order; each rebases to one commit.
User-visible behavior
searchworks on the first call again. Of 1,485searchcalls in one day's sessions, ~1,470 failed withcursor_invalid. Every failure was a first call carrying a placeholder the model invented for "start from the beginning":"""initial"/"INITIAL"".""0""start"/"first"" ","/","null", miscFour different models did this (gpt-5.6-sol 1,028; terra 206; gpt-6-astra 80; luna 10). Only 5 calls omitted the field and succeeded. The error text described what a valid cursor is, not that the field should be omitted, so models cycled through synonyms. One run looped on
search→cursor_invalidfor 1,091 turns until it overflowed its context window; it is one of the eight ENG-940 failures.Design
None of these strings can be a real cursor (encoded cursors are base64 of
path\0linewith a non-empty path), sosearchnow reads them, and whitespace, as "no cursor". A genuinely malformed cursor still errors; the message now leads withomit \cursor` for the first page. The schema'scursor` property carries a description saying the same, and the tool description says "Omit cursor for the first page". No protocol change.Verification
search_pages_with_an_exact_cursor_and_caps_per_file: each placeholder returns byte-for-byte the same page as omitting the field;"!!"still fails with the new text. Fails on the base commit.cargo test -p qq-coregreen (736). clippy-D warningsclean; fmt clean.main. Pre-existing load sensitivity, unrelated to this change.Performance
None: one
trimand a string match per call.