You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Search explanations describe parts the search didn't run #2147
includeExplanation on search_errors and the other runSearchEvents tools returns the embedded agent's own explanation text unchanged. It can describe grouping, fields, or a time range that the executed request does not contain, so callers trust results that don't match what they asked for.
Reported in Sentry MCP user feedback (MCP-SERVER-GN4) from an automated caller:
Grouped time series: an hourly series asked for grouping by project plus distinct users. The explanation said both were returned. executedSearch.fields was only count(), and the output was one ungrouped series. The span for that call was not sampled, so this case is from the feedback text only.
The agent's time-series output is one yAxis plus interval, with no group-by or top-N field (agent.ts:53-72). The handler sends one yAxis to events-timeseries (search.ts:1083-1104) and reports fields: [yAxis] (structured.ts:469). Any grouping or second aggregate the agent planned is dropped without a note.
explanation is set from parsed.explanation (search.ts:932) and passed through unchanged (structured.ts:462-465, formatters.ts:209-210). The handler later overrides the time range, fields, sort, or query (search.ts:910-948), but never compares the explanation with what ran.
Related: #2017 adds explicit multi-axis series for traces, logs, and metrics, not errors and not grouped series. #2139 and #2146 fix time-range drops, not the explanation text.
Call 2 (rerun):timestamp:>= / timestamp:< tokens with period: "14d". The final /events/ request kept the tokens and sent statsPeriod=14d, so the window was right. The explanation again said the absolute bounds had replaced statsPeriod, which isn't what ran.
So the time-range part of the explanation is wrong even when the search is right. The caller had to compare it against executedSearch to notice.
Activity
linear-code commentedon Nov 10, 2026
MCP-1208
sentry-junior commentedon Nov 15, 2026
Another report: Sentry MCP user feedback MCP-SERVER-GQD (python caller, server 0.42.0,
search_errors).environment:filter, withperiod: "14d". The final request ranstatsPeriod=14dwith nostart/end(see fix(search-events): Keep the agent's absolute window when a period is also passed #2146), but the explanation said the absolute bounds had replacedstatsPeriod.timestamp:>=/timestamp:<tokens withperiod: "14d". The final/events/request kept the tokens and sentstatsPeriod=14d, so the window was right. The explanation again said the absolute bounds had replacedstatsPeriod, which isn't what ran.So the time-range part of the explanation is wrong even when the search is right. The caller had to compare it against
executedSearchto notice.Reports: 4 (MCP-SERVER-GP9, GP2, GN4, GQD).