Repository navigation
agent: add CloseReason enum for agent session close reasons - #1887
Merged
Merged
Conversation
Agent evals read the session's close reason from the recording upload's session summary; the enum keeps the value names the same across the Python, JS and Go code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: d7442f4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This was referenced Oct 23, 2026
jmcclanahan
marked this pull request as ready for review
October 23, 2026 20:48
theomonnom
reviewed
Oct 23, 2026
theomonnom
approved these changes
Oct 23, 2026
Co-authored-by: Théo Monnom <theo.monnom@outlook.com>
jmcclanahan
added a commit
to livekit/agents
that referenced
this pull request
Oct 23, 2026
…ol#1887) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jmcclanahan
added a commit
to livekit/agents-js
that referenced
this pull request
Oct 23, 2026
…ol#1887) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
livekit.agent.CloseReasoninagent/livekit_agent_session.proto:CR_UNKNOWN,CR_ERROR,CR_JOB_SHUTDOWN,CR_PARTICIPANT_DISCONNECTED,CR_USER_INITIATED,CR_TASK_COMPLETED.@livekit/protocol.Why
The agents SDKs send a session summary (JSON) in
MetricsRecordingHeader.session_summary(#1884), and agent evals filter on itsclose_reason. Today the Python and JS SDKs each define their ownCloseReason, and they already differ (agents-js has notask_completed). Writing the proto value name into the JSON keeps one list of names for Python, JS and Go.How
CloseReasonto it and write the value name (e.g.CR_PARTICIPANT_DISCONNECTED). A unit test in each SDK checks every SDK reason has a mapping.CR_UNKNOWN(0) covers a missing reason and agents-js custom shutdown strings.AS_,TC_,AMD_).🤖 Generated with Claude Code