Drop 'unknown' model fallbacks across AI integrations

Abierto
#25,353 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

  • #25379 de @kashish00208 — cerrado sin fusionar

Evaluación

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

Línea de trabajo

Start by finding where gen_ai.request.model is set to 'unknown' in packages/server-utils/src/ai/openai/index.ts and the span-name builder in ai/openai/utils.ts, then check the same pattern in the Anthropic, Google GenAI, LangChain and Workers AI files listed in the issue. Done means no model means no gen_ai.request.model attribute and the span is named only by its operation (e.g. chat), with and without span streaming. The review thread linked from PR 25285 explains the intent.

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

Descripción

When a request has no model, the AI integrations set gen_ai.request.model to 'unknown', and the span name becomes <operation> unknown. With span streaming the name drops the model, but the attribute stays.

If there is no model, do not set gen_ai.request.model. The span name is then only the operation (for example chat), with or without span streaming.

Affected integrations (in packages/server-utils/src):

  • OpenAI: ai/openai/index.ts, ai/openai/utils.ts, integrations/openai.ts
  • Anthropic: ai/anthropic-ai/index.ts
  • Google GenAI: ai/google-genai/index.ts, integrations/google-genai.ts
  • LangChain: ai/langchain/index.ts, ai/langchain/utils.ts, ai/langchain/embeddings.ts
  • Workers AI: ai/workers-ai/index.ts, ai/workers-ai/utils.ts

Raised in review: https://github.com/getsentry/sentry-javascript/pull/25285#discussion_r4267469713

Also evaluate other usages of unknown through out all ai integrations.

Furthermore, create test cases where we call providers without specifying a model.

Lenguaje dominante
TypeScript
Estrellas
8.8k
Forks
1.9k
Merge medio
1 d 8 h
PR fusionados (30 d)
744

Preparar el entorno

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/sentry-javascript

Todos los issues de getsentry/sentry-javascript

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.