Skip to content

search_errors agent rewrites issue short IDs in structured queries #2443

Open

Description

@sentry-junior

A structured search_errors query such as issue:PROJ-2B3 still goes through the embedded agent, and the agent's query runs as-is. In the reported session the agent dropped the last character of a valid short ID (issue:PROJ-2B3 became issue:PROJ-2B; placeholder IDs here), and Sentry answered 400 Issue IDs do not exist. The caller worked around it with the numeric issue ID.

Reports: 2

  • MCP-SERVER-GS9 (2026-11-18, search_errors): a valid short ID came back truncated by one character, HTTP 400.
  • MCP-SERVER-GSX (2026-11-20, same client and task, kind=broken, impact=worked_around): asks to preserve full short IDs in translation or resolve them to numeric group IDs.

Verified from the sampled search_errors span (server 0.42.0):

  • Tool args: a single issue:<short id> query, explicit aggregate fields, period=24h, no sort.
  • callEmbeddedAgent received the full short ID in User query: and returned the query with the last character missing, with an explanation claiming it kept the issue filter.
  • validateSearch passed because the validate endpoint doesn't check the errors dataset; the following GET /events/?dataset=errors returned the 400 that the tool passed on.

Why it gets through (toolkit @ aae9b4b):

  • Errors isn't a trace-item dataset, so shouldTrustStructuredTraceSearch is false and canRunWithoutAgent never applies (search.ts:828-835); the agent always runs.
  • Only trace-item datasets get choosePreservingRepairedQuery's token check. For errors the agent's query is used unless isSemanticFilterDowngrade fires (search.ts:979-985), and that doesn't compare filter values.
  • normalizeNumericIssueFilters (utils.ts:319-341) only rewrites numeric IDs and isn't involved.

Related: #2379 (translator turns a bare UUID into trace:), #2212 (search_issues agent rewrites quoted phrases), #2139 (open: restores timestamp: bounds the agent drops, same code spot).

via automation evt_905b9c478746fd9deeb853f85ad7441b · Run ID dispatch_6beea850935f9ba32a9ce5724de8c370.

--

View Session [Sentry]

Activity

  1. linear-code commented on Nov 20, 2026

    @linear-code
  2. added a commit that references this issue on Nov 20, 2026
    19185bc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions