feat(agent-sessions): surface sessionless GenAI traces as single-trace sessions - #655
Merged
Merged
Conversation
…essionless-traces # Conflicts: # apps/web/src/components/agent-sessions/agent-sessions-list.tsx
JeremyFunk
had a problem deploying
to
pr-preview
August 27, 2026 19:01 — with
GitHub Actions
Failure
🍁 Maple PR previewWarning Preview cleanup could not be confirmed. The Alchemy teardown outcome was Final commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GenAI traces whose vendor never emits a session key (haystack, litellm, llamaindex, semantic_kernel, effect_ai, and the
unknown:*buckets) were invisible in Agent Sessions — ingest stampsmaple_ai.vendor.idon them but nevermaple_ai.session.id. This surfaces each such trace as its own single-trace session: the trace is the full context.maple_ai.vendor.idpresence instead of requiring a session id; the outer level groups byif(rawSessionId = '', concat('trace:', traceId), rawSessionId), so sessionless traces become synthesizedtrace:<traceId>sessions. Vendor resolution uses a rankedargMin(…, tuple(rank, Timestamp))ordering so sessionless traces still pick a deterministic earliest vendor-stamped span.aiTraceWindowQuery/aiTraceSpansQuerykeyed directly onTraceId; the APIspanshandler routes on thetrace:prefix viatraceSessionTraceId()(prefix + strict 32-hex validation inpackages/domain). Malformed prefixed ids fall through to the existing empty-session response, and no unvalidated value reaches the query params.Verified: typecheck green across domain / query-engine-integrations / api / web; 313 query-engine-integrations tests (SQL baseline regenerated), 10 handler tests, 286 web agent-session tests; ClickHouse e2e sweep (
bun run ch:test, 302 tests) passes against a real server, covering the new query shapes.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.