Search explanations describe parts the search didn't run

Abierto
#2,147 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
57/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

Start with the time-series agent output in agent.ts:53-72, then follow how search.ts:910-948 builds the executed request and how structured.ts:462-469 and formatters.ts:209-210 return the explanation. Compare the explanation with the request that actually ran, including fields and time range; done means callers are not given an explanation that claims omitted search parts were executed.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
  • Time range: the explanation described a fixed window while executedSearch.timeRange was statsPeriod with null start/end. This one is verified in a trace and fixed in #2146.

What the code does (main @ 737f183):

  • 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.

via Sentry.

--

View Session [Sentry]

Lenguaje dominante
TypeScript
Estrellas
961
Forks
179
Merge medio
15 h 33 min
PR fusionados (30 d)
476

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de getsentry/toolkit

Todos los issues de getsentry/toolkit

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.