Repository navigation
List tasks: GET /v1/tasks, newest first - #217
Merged
Merged
Conversation
The console's Tasks page needs a list. listTasks pages a namespace's tasks newest first with the same keyset cursor as sessions and agent configs, and a new migration adds the (namespace, created_at, id) index that keeps a page from sorting the whole history. A session created directly is not a task and is not listed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
First of two stacked PRs that switch the console from sessions to tasks. The console's Tasks page needs a list, and the api didn't have one. The second PR (the console and the README) will be based on this one.
Changes
ListTasksRequest(namespace, limit, after?).listTasksreturns one namespace's tasks, newest first.listTasksuses the same keyset cursor aslistSessionsandlistAgentConfigs. An unknown cursor, or one from another namespace, throws "unknown cursor".20261027233451_add_tasks_list_scan: an index ontasks (namespace, created_at, id), the same assessions_list_scan. The table's id is random, so without it every page would read and sort the namespace's whole task history. The migration's hash is pinned.GET /v1/tasks?namespace=&limit=&after=returns the usual list envelope,{ data, hasMore, lastId? }. An out-of-range limit or an unresolvable cursor gets a 400.A session created directly with
POST /v1/sessionsisn't a task, so it doesn't appear in this list. That route stays in the api; only the console stops using it.Tests
getTaskreturnslimitand the cursorpnpm typecheck,pnpm format:checkandpnpm testpass.🤖 Generated with Claude Code