Repository navigation
atlas-search(service): bound the results-paging loop — deadline + cursor-progress guard (#5424) - #5437
Conversation
The paging loop in search() now honors the same 330s client deadline as the poll loop, and a next_cursor that does not advance (or an empty page that still returns a cursor) is a malformed response returning Err, so the caller falls back to standalone loudly instead of hanging forever. Adds stub-service unit tests: repeating cursor returns Err promptly, empty page with cursor returns Err, multi-page happy path unchanged. cargo test -p atlas-search green.
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. |
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
Fixes #5424 (queue task 9435).
The via-service client's results-paging loop in
service.rssearch()had no deadline and no cursor-progress guard: a well-formed but non-advancing page stream (repeating cursor, or empty pages that keep returning a cursor) looped forever, hanging the CLI instead of returning theErrthat triggers the documented loud standalone fallback.deadline, already computed for the poll loop) on every iteration and returnsErrwhen it expires mid-paging.next_cursorequal to the cursor just used, or an empty page that still returns a cursor, is a malformed response:Err, not another iteration.search()is split intosearch()(token resolution) +search_with_token()so the flow is unit-testable without env mutation.search_repeating_cursor_returns_err_promptly— repeating cursor returnsErr("did not advance") promptly.search_empty_page_with_cursor_returns_err— empty page with a cursor returnsErr.search_multi_page_happy_path_unchanged— two-page happy path still splices both pages.Tests:
cargo test -p atlas-searchgreen on the laptop (full suite exit 0; the 3 new tests pass by name);cargo fmt -p atlas-searchapplied.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit