Conversation
Wire an on_session_end callback that tags the session outcome via ctx.tagger and points to the Agent Observability tags and evals docs. https://claude.ai/code/session_01Mkt7G86CNXSTmhRrwHcL2A
…tani-sxwxyk # Conflicts: # src/agent.py
The on_session_end handler previously demonstrated only heuristic outcome tagging (chat length). Add a JudgeGroup running safety, coherence, and conciseness judges to also demonstrate production evals — verdicts are auto-tagged as lk.judge.<name>. Judging is gated behind the engagement check so empty sessions don't incur a model call.
Per review: judges should run unconditionally (not gated behind the engagement heuristic), and relevancy fits a general assistant better than coherence. Swap coherence_judge -> relevancy_judge and remove the early return so the JudgeGroup evaluates every session. Outcome tagging (success/fail) is unchanged.
bcherry
marked this pull request as draft
September 17, 2026 21:20
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.
Summary
Adds comprehensive session observability to the agent by implementing session end callbacks that tag conversations and evaluate quality using LLM-as-judge verdicts.
Key Changes
New
on_session_endcallback: Implements session lifecycle observability with:Judge integration: Evaluates every session using
JudgeGroupwith three production-ready judges:safety_judge()- Ensures responses are safe and appropriaterelevancy_judge()- Validates response relevance to user queriesconciseness_judge()- Checks response concisenessSession registration: Wires the callback into the agent via
on_session_endparameter in@server.rtc_sessiondecoratorDocumentation update: Enhanced README to explicitly mention session tags and production evals as key features
Implementation Details
lk.judge.<name>for filtering and analysis in LiveKit Cloudhttps://claude.ai/code/session_01Mkt7G86CNXSTmhRrwHcL2A