Repository navigation
fix(search-events): Translate prose that contains a filter token - #2263
sentry-junior[bot] wants to merge 1 commit into
Conversation
`search_traces` ran natural-language requests verbatim when they also contained a filter, such as `environment:production, count grouped by span.op` or `production transactions (is_transaction:true), show release`. The query passed `looksLikeSentrySearchSyntax`, so it was trusted as a structured trace search. The embedded agent translated it correctly, but `choosePreservingRepairedQuery` requires the repaired query to keep every original token, prose included, so it fell back to the original sentence. Sentry searched for the prose as literal text and returned nothing, with no warning. A query with filters plus two or more unquoted free-text words is now a natural-language request. The agent's translation runs, and the existing `isSemanticFilterDowngrade` guard still rejects rewrites that turn a filter into full-text matching. Pure filter queries, quoted phrases, and a single free-text term next to a filter (`span.op:db SELECT`) are still trusted as typed. Refs MCP-SERVER-GQ5, MCP-SERVER-GMW
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
Another report of this pattern, this time from The caller sent a sentence with filter tokens in it, along with explicit
The query has filter tokens, The On this branch, I ran The same report also hit a different bug: open-ended "since X" ranges. That one is tracked separately in #2272. |
|
Another report of this pattern, from The user's agent said What I could check in the traces:
So this report matches the pattern by its description, but the trace evidence only covers the workaround. Confidence: medium. |
search_tracesruns a natural-language request verbatim when it also contains a filter token. Sentry then searches the prose as literal text and returns nothing, with no warning. User feedback MCP-SERVER-GQ5 and MCP-SERVER-GMW both report this.In production (MCP server 0.42.0), one call sent
query = "production transactions (is_transaction:true), show timestamp, transaction, span.op, release". The embedded agent'svalidateSearchcall builtsentry.environment:production AND is_transaction:trueand gotvalid: true. Even so,executedSearch.querywas the original sentence, and the search returned nothing.Cause
search_tracesalways sendsdataset: "spans". So any query that passeslooksLikeSentrySearchSyntaxtakes the trusted structured-trace path (shouldTrustStructuredTraceSearch). On that path,choosePreservingRepairedQuerykeeps the agent's rewrite only when every original token appears in it. That includes prose words likeshow,grouped, andrelease,. A correct translation never has those words, so the original sentence runs instead.Change
A query with filters plus two or more unquoted free-text words (
mixesSearchSyntaxWithProse) is now handled as natural language, so the agent's translation runs. The existingisSemanticFilterDowngradeguard still rejects rewrites that turn a filter into full-text matching, and explicit fields, sort, and period are still kept. These queries are still trusted as typed:span.op:db SELECTOpen question: a query with filters plus several literal free-text words now goes through the agent instead of running as typed. Two or more words matches the existing natural-language heuristic in
formatUntranslatedQueryNote. Seer still skips queries that contain a filter token, so mixed queries go to the embedded agent.via Sentry.
--
View Session [Sentry]