Skip to content

fix(ingest): fall back to gen_ai.conversation.id for every vendor - #1139

Merged
JeremyFunk merged 2 commits into
mainfrom
fix/ingest-conversation-id-fallback
Sep 30, 2026
Merged

JeremyFunk merged 2 commits into
mainfrom
fix/ingest-conversation-id-fallback

fix(ingest): rank the conversation id ahead of session.id for unknown…

062ce5a
Select commit
Loading
Failed to load commit list.
Maple Review Bot / Maple / review succeeded Sep 30, 2026 in 59s

Confidence 4/5 · No issues found

🟢 Confidence 4/5 · likely safe to merge
One deterministic ordering rule in run_predicates, covered by new tests for both the fallback and the vendor-key precedence, with no warehouse or migration change.
quality 100/100 · no findings · tests covered · risk medium

Ingest now appends gen_ai.conversation.id after each matched vendor's own session keys, so spans from the 11 vendors that never listed it group into a session instead of one trace:<id> per trace. Contained to classification, with matching Rust tests; safe to merge.

  • run_predicates tries gen_ai.conversation.id last for every vendor, unless the list already ranks it
  • unknown:openinference now ranks the conversation id ahead of OpenInference's session.id
  • Module doc and the session-turns.ts comment restate the new precedence
What was checked
  • Fallback is appended after the vendor's own keys and skipped when the list already contains the key (ai_session.rs:1049); google_adk, langchain, llamaindex, openai_agents_sdk, vercel_ai_sdk keep their…
  • detect_maple still keys on maple_ai.session.id presence (ai_session.rs:1082) and has_vendor_stamp clears it (ai_session.rs:752), so a re-ingested stamp cannot re-derive the vendor
  • The session.id merge risk applies only where the browser SDK's replay id is the top key: openinference-openai still requires the OpenAI instrumentation scope, and browser spans carry Maple's own s…

062ce5a · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.