Fix Desktop connection: Add ContentNegotiation, SLF4J, and native access#45
Merged
Conversation
… args Co-authored-by: paulpv <1393897+paulpv@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix serialization and connection errors in desktop application
Fix Desktop connection: Add ContentNegotiation, SLF4J, and native access
Dec 23, 2025
paulpv
approved these changes
Dec 23, 2025
There was a problem hiding this comment.
Pull request overview
This PR fixes Desktop's inability to connect to the OpenAI Realtime API by adding missing Ktor ContentNegotiation plugin, SLF4J logging implementation, and JVM native access permissions. The Desktop platform now mirrors Android's HTTP client configuration pattern, enabling proper JSON serialization for ephemeral token requests.
- Added ContentNegotiation plugin to Desktop's HttpClient with JSON serialization support
- Added SLF4J simple implementation dependency to suppress NOP logger warnings
- Configured JVM arguments to enable native access for Skiko library
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
gradle/libs.versions.toml |
Added SLF4J version definition (2.0.16) and library declaration for slf4j-simple |
core/src/desktopMain/kotlin/llc/lookatwhataicando/codeoba/core/data/realtime/RealtimeClientImpl.kt |
Changed HttpClient from bare instantiation to CIO engine with ContentNegotiation plugin, matching Android's pattern with ignoreUnknownKeys and isLenient JSON configuration |
app-desktop/build.gradle.kts |
Added slf4j-simple dependency implementation and JVM argument --enable-native-access=ALL-UNNAMED to suppress Skiko native library warnings |
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.
Desktop failed to connect to OpenAI Realtime API due to missing Ktor ContentNegotiation plugin, causing JSON serialization errors when requesting ephemeral tokens. Additional warnings from missing SLF4J provider and Skiko native access permissions cluttered logs.
Changes
Add ContentNegotiation to Desktop HttpClient (
core/src/desktopMain/.../RealtimeClientImpl.kt)HttpClient()toHttpClient(CIO)with ContentNegotiation pluginHttpClient(OkHttp)with ContentNegotiation)Add SLF4J implementation (
app-desktop/build.gradle.kts,gradle/libs.versions.toml)slf4j-simple:2.0.16dependency to suppress NOP logger warningsConfigure native access (
app-desktop/build.gradle.kts)--enable-native-access=ALL-UNNAMEDJVM arg for Skiko libraryBefore/After
Before:
After:
Error that should no longer occur:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.