Repository navigation
fix: don't crash on malformed agent attributes - #1053
Merged
Merged
Conversation
Participant.updateFromInfo parsed lk.agent.inputs / lk.agent.outputs as JSON for every participant without catching errors. A value that wasn't a JSON array threw out of the signal handling coroutine and crashed the app. Catch and log the parse failure, leaving the previous agent attributes in place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 5a796ec The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Contributor
|
Diffuse output: AAR |
1egoman
marked this pull request as ready for review
October 29, 2026 23:15
1egoman
requested review from
MaxHeimbrock,
davidliu and
xianshijing-lk
as code owners
October 29, 2026 23:15
davidliu
approved these changes
Oct 30, 2026
Open
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
Participant.updateFromInfoparses thelk.agent.inputsandlk.agent.outputsattributes as JSON arrays (AgentAttributes.fromStringMap) for every participant. If either value isn't a JSON array of strings, the parse throws. That exception escapesupdateFromInfointo the signal handling coroutine, which has no exception handler, and crashes the app.This PR wraps that single call in a
try/catch. A parse failure is logged as a warning, and the participant's previousagentAttributesare left in place. Everything else inupdateFromInfo(attributes, state, permissions, etc.) is still applied.Test plan
RoomMockE2ETest.participantConnectedWithMalformedAgentAttributes: a participant joins withlk.agent.inputs = "not json"and is still added to the room. Before this change the parse exception escaped signal handling and the participant was never added../gradlew :livekit-android-test:testDebugUnitTest --tests 'io.livekit.android.room.RoomMockE2ETest' --tests 'io.livekit.android.room.types.*'spotlessCheck(couldn't run locally from a git worktree; left to CI)🤖 Generated with Claude Code