Skip to content

Restore IllegalStateException from the provider serializers - #76

Merged
pambrose merged 1 commit into
masterfrom
restore-provider-serializer-illegalstate
Nov 13, 2026
Merged

pambrose merged 1 commit into
masterfrom
restore-provider-serializer-illegalstate

Conversation

@pambrose

Copy link
Copy Markdown
Member

Summary

#71 switched the model, voice, transcriber and transfer-destination serializers from IllegalStateException to SerializationException for an unregistered DTO class. It did so because kotlinx-serialization 1.12 wrapped every other exception in JsonEncodingException. #75 moved to kotlinx-serialization 1.13.0, which reverts that wrapping. The switch no longer serves a purpose, and it would be an unnecessary behavior change for consumers who catch IllegalStateException.

Test plan

  • ./gradlew :vapi4k-core:test --tests ProviderSerializerErrorTest --tests ModelSerializerTest passes: 20 tests, including all four unregistered-DTO cases
  • :vapi4k-core:lintKotlin and :vapi4k-core:detekt pass
  • Full test suite in CI

🤖 Generated with Claude Code

#71 switched the model, voice, transcriber and transfer-destination
serializers to throw SerializationException for an unregistered DTO class,
because kotlinx-serialization 1.12 wrapped any other exception in
JsonEncodingException. kotlinx-serialization 1.13.0 (#75) reverted that
wrapping, so the switch is no longer needed and would only be a behavior
change for consumers catching IllegalStateException.

- Serializers use error("Invalid <kind> provider: ...") again; the four
  files match their pre-#71 contents
- ModelSerializerTest and ProviderSerializerErrorTest assert exactly
  IllegalStateException with the same message, which also guards against
  kotlinx-serialization reintroducing the wrapping
- CHANGELOG / RELEASE_NOTES: drop the serializer entry and the now-empty
  "Upgrading from 1.8.2" section
- llms.txt: Kotlinx Serialization 1.13.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov

codecov Bot commented Nov 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@pambrose
pambrose merged commit bcd592e into master Nov 13, 2026
11 checks passed
@pambrose
pambrose deleted the restore-provider-serializer-illegalstate branch November 13, 2026 19:33
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.

1 participant