Skip to content

fix: don't crash on malformed agent attributes - #1053

Merged
davidliu merged 1 commit into
mainfrom
fix-malformed-agent-attributes-crash
Oct 30, 2026
Merged

davidliu merged 1 commit into
mainfrom
fix-malformed-agent-attributes-crash

Conversation

@1egoman

@1egoman 1egoman commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Participant.updateFromInfo parses the lk.agent.inputs and lk.agent.outputs attributes as JSON arrays (AgentAttributes.fromStringMap) for every participant. If either value isn't a JSON array of strings, the parse throws. That exception escapes updateFromInfo into 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 previous agentAttributes are left in place. Everything else in updateFromInfo (attributes, state, permissions, etc.) is still applied.

Test plan

  • New RoomMockE2ETest.participantConnectedWithMalformedAgentAttributes: a participant joins with lk.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

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-bot

changeset-bot Bot commented Oct 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5a796ec

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
client-sdk-android Patch

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

@github-actions

Copy link
Copy Markdown
Contributor

Diffuse output:

OLD: diffuse-source-file
NEW: livekit-android-sdk-release.aar

 AAR      │ old      │ new      │ diff   
──────────┼──────────┼──────────┼────────
      jar │  3.1 MiB │  3.1 MiB │ +604 B 
 manifest │  1.5 KiB │  1.5 KiB │    0 B 
 lint-jar │ 12.7 KiB │ 12.7 KiB │    0 B 
    other │  2.4 KiB │  2.4 KiB │    0 B 
──────────┼──────────┼──────────┼────────
    total │  3.1 MiB │  3.1 MiB │ +604 B 

 JAR     │ old   │ new   │ diff      
─────────┼───────┼───────┼───────────
 classes │  1771 │  1771 │ 0 (+0 -0) 
 methods │ 22473 │ 22473 │ 0 (+0 -0) 
  fields │  5910 │  5910 │ 0 (+0 -0)
AAR
 size    │ diff   │ path          
─────────┼────────┼───────────────
 3.1 MiB │ +604 B │ ∆ classes.jar 
─────────┼────────┼───────────────
 3.1 MiB │ +604 B │ (total)

@1egoman
1egoman marked this pull request as ready for review October 29, 2026 23:15

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@davidliu
davidliu merged commit dc60d43 into main Oct 30, 2026
6 checks passed
@davidliu
davidliu deleted the fix-malformed-agent-attributes-crash branch October 30, 2026 07:02
@davidliu davidliu mentioned this pull request Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants