Align `gen_ai.decide` span payloads with the AI Agents module spec

Aberta
#25,614 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
45/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
typescript

Direção de pesquisa

Start with packages/server-utils/src/ai/core/utils.ts and the OpenAI mapping and integration tests mentioned in the issue. Compare emitted decision inputs and outputs with the linked Decision span spec, then trace the shared token usage helper and TypeSafe addResponseAttributes; the issue notes that changing shared token handling affects all AI spans. Check real Jev output for the noul fields, and update or add tests for the agreed payload behavior.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

The Decision span spec and our decide spans differ in some places. This applies to all decide integrations: TypeSafe / LangChain Jev, Workers AI (Jev, Clef), OpenAI decisions, Vercel AI experimental_decide, and the Mastra classifier.

The op, the span name, the operation name, the model, and the tokens are correct. The question and answer layouts are correct (OpenAI is converted in openai/mapping.ts).

Gaps

  1. Extra type: "evaluation" key. We send [{type: "evaluation", state, questions}] and [{type: "evaluation", answers}]. The spec says [{state, questions}] and [{answers}]. Remove the key in getEvaluationInputMessages / getEvaluationOutputMessages (packages/server-utils/src/ai/core/utils.ts), or add the key to the spec.
  2. No [Blob substitute] in state. The spec says to replace binary data and data: URLs. We send them raw. The OpenAI v7 integration test asserts that a data:image/png;base64,... input goes out unchanged.
  3. We send gen_ai.usage.total_tokens. The spec lists it under "Derived by Relay, don't send". TypeSafe addResponseAttributes, OpenAI, and the shared getTokenUsageAttributes set it. Relay overwrites the value, so nothing breaks. The shared helper is used by all AI spans, so this fix is wider than decide spans.
  4. gen_ai.agent.name is not set when a decision runs inside an agent. Low priority.

Open question

The spec has a noul question type and a noul answer field. None of our fixtures has a noul answer, so check it against real Jev output.

Linguagem predominante
TypeScript
Estrelas
8.8k
Forks
1.9k
Merge médio
1d 8h
PRs com merge (30d)
744

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de getsentry/sentry-javascript

Todas as issues de getsentry/sentry-javascript

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.