feat(snuba): Add AI_CONVERSATION trace item type - #372
Draft
pbhandari wants to merge 1 commit into
Draft
Conversation
|
The latest Buf updates on your PR. Results from workflow ci / buf-checks (pull_request).
|
pbhandari
marked this pull request as draft
July 20, 2026 15:28
| TRACE_ITEM_TYPE_PROCESSING_ERROR = 13; | ||
| TRACE_ITEM_TYPE_AI_CONVERSATION = 14; | ||
| } | ||
|
|
There was a problem hiding this comment.
Bug: The auto-generated Rust code in rust/src/sentry_protos.snuba.v1.rs is out of sync with the updated protobuf definition, missing the new TRACE_ITEM_TYPE_AI_CONVERSATION enum variant.
Severity: CRITICAL
Suggested Fix
Run the code generation script to update the auto-generated Rust files. Based on the CI configuration, this can be done by running make build-rust locally. Commit the updated rust/src/sentry_protos.snuba.v1.rs file to ensure the Rust code is synchronized with the protobuf definition before merging.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: proto/sentry_protos/snuba/v1/request_common.proto#L80
Potential issue: The protobuf definition in `request_common.proto` was updated to
include `TRACE_ITEM_TYPE_AI_CONVERSATION`, but the corresponding auto-generated Rust
code in `rust/src/sentry_protos.snuba.v1.rs` was not regenerated. As a result, the Rust
`TraceItemType` enum is missing the `AiConversation` variant. This will cause
deserialization failures when any Rust service attempts to process a protobuf message
containing `trace_item_type = 14`. The value may be incorrectly interpreted as
`Unspecified` or cause a runtime error, preventing the new feature from working in
Rust-based consumers.
Did we get this right? 👍 / 👎 to inform future reviews.
pbhandari
force-pushed
the
feat/ai-conversation-trace-item-type
branch
from
July 20, 2026 15:33
031916c to
61fe235
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 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
Adds
TRACE_ITEM_TYPE_AI_CONVERSATIONto theTraceItemTypeenum insnuba/v1.AI conversations can be queried through the existing
TraceItemTableendpoint by settingRequestMeta.trace_item_typeto this new value.TraceItemTablealready supports everything the use case needs:columns(eachColumnmay be a plain attribute)Column.aggregationColumn.conditional_aggregationfilter, ordering viaorder_by, and HAVING viaaggregation_filterSo no new endpoint is required — a dedicated
GetAiConversationsrequest/response would have been a strict subset ofTraceItemTableRequest. Adding an enum value is backwards compatible.Test plan
buf lint/buf formatpass (pre-commit)protoccompiles the package cleanly🤖 Generated with Claude Code