Repository navigation
SWF(bug): honor after cursor and has_more in conversation item listing - #58
Merged
maplepaladin73 merged 1 commit intoNov 22, 2026
Merged
Conversation
…sting Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
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.
Summary
GET /v1/conversations/{id}/itemsnow pages like OpenAI:afterskips past the cursor item (in the requestedorder),has_moreis true when items remain beyondlimit, and an unknownafterid returns 400 (param: "after",code: "item_not_found").Root cause:
list_conversation_itemsnever read theafterquery param, truncated the full ordered list, and hard-coded"has_more": false. Solimit=1reported no more pages, andafter=<first id>returned the first item again.Try it:
ATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo test -p spark-server --bin spark conversation_items_pagination(runbash scripts/ci_gpu_stubs.shonce first on a GPU-less box)Test plan
New regression tests in
api/tests/conversation_items_pagination.rs(limit=1 has_more, after=first returns second, last page, desc+after, unknown after → 400, empty conversation).Before the fix (5 of 6 fail):
After the fix:
Full
sparkbin suite:test result: ok. 3225 passed; 0 failed; 14 ignored.Live check: modelless
spark serve, a conversation with itemsfirst,second,third:cargo fmt --all -- --checkATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo clippy --workspace --tests(clean)bash scripts/check-license-headers.sh(0 invalid)typos(clean)Notes for reviewers
before(not supported here, and not part of this fix).afterid rather than silently returning page one, so clients with a bad cursor get an error instead of repeated data.CLA
Implemented in session Fix conversation items pagination cursor and has_more
Review with Devin · Open in Devin Desktop