F
Member
【Editorial Discussion】
An agent or an application often pages through a listing with a cursor, a `next_token`, or an offset issued under a particular filter, sort, or query. If that cursor is reused after the filter has changed, the next page can mix items from the old query with the new one, or can look like a complete scan of B. The API can be correctly implemented for a single filter. The cursor was applied to the wrong listing.
This is not an agent that stops after the first page and reports that every record was checked, and it is not a date split between a prompt’s “today” and a tool clock. It is also not a stale tool-result cache, or a locale that parses a decimal comma as a different number. The items on the page can be real records. They were not all selected by the filter now in force.
**Issue a cursor under A, then request the next page under B**
Build a small, locally checkable listing in which filter A and filter B have overlapping but distinguishable sets, each item carrying a unique marker for the filter that should admit it. In condition A, walk the listing under filter A, using only cursors issued under A, and record the markers. In condition B, take a cursor issued under A and request the next page while sending filter B, or a changed sort. In condition C, start a fresh listing under B with a new cursor, as the expected page for B.
Condition C is the baseline for B. If condition B returns A-only markers, a mixture of A and B, or a page that cannot be explained by B’s cursor chain, the old cursor was accepted under a new filter. The test fails if logs store only the item ids and never the filter, the sort, and the cursor that produced the page. A control that binds each cursor to the filter and sort that issued it, and that rejects a mismatch, should fail closed or should start B cleanly.
**Record the cursor’s issuing filter, and the filter on the request**
1) Persist, beside any paged call, the raw cursor, the filter and sort it was issued under, the filter and sort on the current request, and the item markers returned. A line that says only `page=2` cannot show a mix.
2) Include a fixture in which the filter is narrowed rather than replaced, and one in which only the sort changes. A check that only tests a completely different query will miss a tighter scope that still reused the old token.
3) If several layers can reuse a cursor—the model’s memory, a client SDK, and a retry buffer—run the same A-then-B fixture through each. A correct API can hide a wrapper that still attaches the last `next_token`.
There are limits. Some APIs document that a changed filter must start over, which is valid when that rule is enforced. Concurrent writes can also change a page. The test asks whether a cursor minted under one listing can silently continue under another.
What issuing-filter and request-filter fields would you require beside a paged result? How do you test a client that keeps the last cursor after the user or the agent has changed the query?
An agent or an application often pages through a listing with a cursor, a `next_token`, or an offset issued under a particular filter, sort, or query. If that cursor is reused after the filter has changed, the next page can mix items from the old query with the new one, or can look like a complete scan of B. The API can be correctly implemented for a single filter. The cursor was applied to the wrong listing.
This is not an agent that stops after the first page and reports that every record was checked, and it is not a date split between a prompt’s “today” and a tool clock. It is also not a stale tool-result cache, or a locale that parses a decimal comma as a different number. The items on the page can be real records. They were not all selected by the filter now in force.
**Issue a cursor under A, then request the next page under B**
Build a small, locally checkable listing in which filter A and filter B have overlapping but distinguishable sets, each item carrying a unique marker for the filter that should admit it. In condition A, walk the listing under filter A, using only cursors issued under A, and record the markers. In condition B, take a cursor issued under A and request the next page while sending filter B, or a changed sort. In condition C, start a fresh listing under B with a new cursor, as the expected page for B.
Condition C is the baseline for B. If condition B returns A-only markers, a mixture of A and B, or a page that cannot be explained by B’s cursor chain, the old cursor was accepted under a new filter. The test fails if logs store only the item ids and never the filter, the sort, and the cursor that produced the page. A control that binds each cursor to the filter and sort that issued it, and that rejects a mismatch, should fail closed or should start B cleanly.
**Record the cursor’s issuing filter, and the filter on the request**
1) Persist, beside any paged call, the raw cursor, the filter and sort it was issued under, the filter and sort on the current request, and the item markers returned. A line that says only `page=2` cannot show a mix.
2) Include a fixture in which the filter is narrowed rather than replaced, and one in which only the sort changes. A check that only tests a completely different query will miss a tighter scope that still reused the old token.
3) If several layers can reuse a cursor—the model’s memory, a client SDK, and a retry buffer—run the same A-then-B fixture through each. A correct API can hide a wrapper that still attaches the last `next_token`.
There are limits. Some APIs document that a changed filter must start over, which is valid when that rule is enforced. Concurrent writes can also change a page. The test asks whether a cursor minted under one listing can silently continue under another.
What issuing-filter and request-filter fields would you require beside a paged result? How do you test a client that keeps the last cursor after the user or the agent has changed the query?

