Add sorting/backwardsCursor to thread/list and new thread/turns/list api#17305
Merged
Add sorting/backwardsCursor to thread/list and new thread/turns/list api#17305
Conversation
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Contributor
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 22eb1fd251
ℹ️ 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".
jif-oai
reviewed
Apr 10, 2026
c6506c2 to
a7337fe
Compare
baf57e4 to
1d907c9
Compare
414ada9 to
85f967f
Compare
a34e5cb to
37c621d
Compare
jif-oai
approved these changes
Apr 17, 2026
Collaborator
jif-oai
left a comment
There was a problem hiding this comment.
This will break previously issued cursor but I don't think we care
The comments mentionned before on stability over same ms cursors is still valid but it's out of scope for this PR
9e87242 to
510c3d3
Compare
To improve performance on connection/reconnection to a remote appserver, we want to allow for delta syncs of the thread list, so that you only get what updated since you last connected (in short reconnections, expected to be zero items). This requires adding an ascending sort option to the thread search (both the sqlite DB query and the filesystem-based query), and then adding a slightly different sortkey for the ascending sort to efficiently support these delta syncs. Note: This was codexed up, though iterated on a few times to make the implementation as clean as made sense to my untrained eye (not used to this codebase). There's still models at a few layers for the sortdirection that feel ugly but seems consistent with other search parameters so may be fine. The biggest ugliness is in the non-sqlite filesystem-backed query mode, where the ascending sort is pretty gross, but I don't think there's a better answer there, and it seems like that path is an edge case. added a backwards_cursor to let you sync forwards and backwards add a thread/turns/list call to paginate through turn data move completely from threadsortdirection to sortdirection, update readme fix rebase-from-main issues pr feedback/build issues build fix
510c3d3 to
9b23432
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
To improve performance of UI loads from the app, add two main improvements:
thread/listapi now gets asortDirectionrequest field and abackwardsCursorto the response, which lets you paginate forwards and backwards from a window. This lets you fetch the first few items to display immediately while you paginate to fill in history, then can paginate "backwards" on future loads to catch up with any changes since the last UI load without a full reload of the entire data set.thread/turns/listapi which also has sortDirection and backwardsCursor for the same behavior asthread/list, allowing you the same small-fetch for immediate display followed by background fill-in and resync catchup.