chore(weave): API for querying queue items #5882
Open
+1,028
−10
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.

Add Annotation Queue Items Query API
This PR adds backend and frontend support for querying annotation queue items with pagination and sorting capabilities.
Backend Changes
New API Endpoint:
annotation_queue_items_queryType Definitions
AnnotationQueueItemsQueryReqandAnnotationQueueItemsQueryResto trace server interfaceAnnotationQueueItemSchemato include all necessary fields for displaying queue itemsQuery Builder (
annotation_queues_query_builder.py)make_queue_items_queryfunction with support for:call_started_at,call_op_name,created_at,updated_atORDER BY created_at ASC, id ASCas default to ensure stable pagination when multiple items have identical timestampsImplementation Across Trace Server Layers
clickhouse_trace_server_batched.py- Main ClickHouse implementationexternal_to_internal_trace_server_adapter.py- ID conversion adapter layercaching_middleware_trace_server.py- Passthrough caching middlewareremote_http_trace_server.py- HTTP client implementationSchema Cleanup
added_atfield: Eliminated redundant timestamp field, usingcreated_atinsteadTesting
New Test Coverage
test_annotation_queue_items_query_basic- Basic query functionalitytest_annotation_queue_items_query_with_pagination- Pagination with limit/offsettest_annotation_queue_items_query_with_sorting- Custom sort orderstest_annotation_queue_items_query_empty_queue- Empty queue edge casetest_annotation_queue_items_query_with_multiple_sort_fields- Multi-field sortingRelated Work
This PR builds on the annotation queues feature introduced in earlier commits and prepares the foundation for the upcoming annotation review interface where users will interact with queued calls to provide feedback and annotations.