Skip to content

Fix ingest compatibility metadata gaps#22

Open
haasonsaas wants to merge 1 commit into
raindrop-ai:mainfrom
haasonsaas:codex/ingest-compat-followups
Open

Fix ingest compatibility metadata gaps#22
haasonsaas wants to merge 1 commit into
raindrop-ai:mainfrom
haasonsaas:codex/ingest-compat-followups

Conversation

@haasonsaas
Copy link
Copy Markdown
Contributor

Summary

This fixes three ingest compatibility gaps I found while reviewing the core SDK/OpenLLMetry path:

  • Preserve legacy Cohere/OpenLLMetry prompt content emitted as gen_ai.prompt.N.user when normalizing indexed gen_ai.prompt.* messages.
  • Honor top-level raindrop.replayRunId, which parse.ts documented as supported but did not actually read.
  • Persist and display total-only token usage from attributes such as llm.usage.total_tokens, instead of dropping it when split input/output token counts are unavailable.

I searched existing issues/PRs for gen_ai.prompt.0.user, Cohere, replayRunId, and total_tokens. I did not find an existing issue/PR for these follow-ups. The only related open PR is #19, which covers the separate legacy gen_ai.usage.prompt_tokens / gen_ai.usage.completion_tokens mismatch.

Details

  • Adds spans.total_tokens plus the generated Drizzle migration/assets.
  • Carries total_tokens through ingest, cloud/saved run mapping, API schemas, span skeletons, filtering/sorting, and run/detail displays.
  • Keeps split input/output tokens as the source for existing cost calculation; total-only counts are shown as token metadata but not treated as split cost inputs.
  • Adds parser tests for top-level replay IDs, Cohere .user prompt normalization, and total-only usage attributes.

Validation

  • bun test tests/parse.test.ts
  • bun test tests/
  • bun x tsc --noEmit
  • bun run build
  • bun run lint (passes with existing warnings)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant