Repository navigation
fix(search): allow auto cursor follow-up - #1563
Conversation
Problem: search cursors are minted for the resolved retrieval lane, but callers often leave follow-up requests at the default retrieval_lane=auto. The Python API path rejected a dialogue cursor on an auto follow-up, and the shared cursor helper could also reject empty successor pages before any hit resolved the lane. What changed: centralize cursor/request lane compatibility so auto remains compatible with any concrete cursor lane while concrete lane switches still fail. Cover both apply_search_cursor and the archive search-envelope builder follow-up path. Verification: pytest -q tests/unit/surfaces/test_search_cursor_pagination.py tests/unit/api/test_search_envelope_builder.py tests/unit/surfaces/test_search_envelope_contract.py --tb=short; ruff format/check touched files; mypy touched files; devtools render-all --check; devtools verify --json.
|
Warning Review limit reached
Your plan includes 1 review of capacity. Refill in 9 minutes and 53 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Allows search cursors minted for a resolved concrete lane, such as
dialogue, to be reused on the normal follow-up request that still asks forretrieval_lane=auto.Problem
Ranked search cursors encode the resolved lane so concrete lane switches can be rejected. But
autois a planner request, not a concrete ranking lane. A first page with defaultautocan resolve todialogueand mint a dialogue cursor; the Python API search-envelope builder rejected the next defaultautorequest before it could fetch the successor page. The shared cursor helper also rejected empty follow-up pages before any hit could establish a resolved lane.Solution
auto, empty, or unspecified requested lanes as compatible with a concrete cursor lane.dialoguecursor withhybridrequest still fails).apply_search_cursorandbuild_archive_search_envelopewith focused regressions.Ref #873
Verification
pytest -q tests/unit/surfaces/test_search_cursor_pagination.py tests/unit/api/test_search_envelope_builder.py tests/unit/surfaces/test_search_envelope_contract.py --tb=short— 21 passed.ruff format --check polylogue/surfaces/payloads.py polylogue/api/search_envelope_builder.py tests/unit/surfaces/test_search_cursor_pagination.py tests/unit/api/test_search_envelope_builder.py && ruff check ...— passed.mypy polylogue/surfaces/payloads.py polylogue/api/search_envelope_builder.py tests/unit/surfaces/test_search_cursor_pagination.py tests/unit/api/test_search_envelope_builder.py— passed.devtools render-all --check— passed.devtools verify --json— exit 0; 299 pytest-testmon selected tests passed; total 110.03s.devtools verify --quick— exit 0; total 35.68s.