chore: clear the compile warnings, and two defects release QA found - #235
Merged
Conversation
Nothing here changes behaviour; each is a warning the build has been carrying. Redundant null handling on OkHttp's `Response.body`, which is non-null — four safe calls in the demo, three `!!` in the interceptor tests. `McpJsonSchema` had three per-declaration `@OptIn(ExperimentalSerializationApi)` that still left two sites uncovered; one file-level opt-in covers the file, which is what it always meant. `NsdServiceInfo.host` was deprecated by API 34 in favour of `hostAddresses`, and minSdk here is 23, so the two are chosen between at runtime. Taking the first of the list matches what `host` documented itself to return, so the branches agree rather than merely both compiling. Compose deprecations: `TabRow` and `ScrollableTabRow` become the `Secondary*` variants — those keep the full-width indicator, so this is a rename and not a restyle, where `Primary*` would also change how the tabs look. `MenuAnchorType` becomes `ExposedDropdownMenuAnchorType`, matching what SessionSelectorView already used. `compose.desktop.<platform>` accessors were deprecated in favour of naming the dependency. The coordinates written out are exactly what those accessors resolved to, checked by resolving each of the four configurations before and after. `js(IR)` loses its argument (IR is the only compiler), `Configuration.isVisible` goes, `@Inject` moves to the class where it is the only annotated constructor, and test-annotations opts into `-Xexpect-actual-classes` — it is the one module declaring an expect/actual annotation, and the flag is how KT-61573 asks you to acknowledge Beta rather than a way of hiding it. `LocalClipboardManager` is deliberately left. Compose Multiplatform 1.11.1 offers no plain-text helper on the replacement, so migrating means writing AWT `StringSelection` handling into four Compose screens against an API whose own shape is still moving — not a trade worth making in a release window for a deprecation that works.
The delegate appends to the results list from the main run loop, while the read at the end of the browse happens on whatever thread the coroutine resumed on once the timeout expired — and the browser is still live at that moment, because cancellation only *dispatches* the stop to the main queue. Nothing ordered the two. Android's actual has used a synchronized list for this all along. An AtomicReference rather than a lock: appends come from the main queue alone, so there is a single writer and read-then-store needs no CAS loop. Only the visibility is missing, and that is what the atomic supplies.
There were two, sharing a simple name and both on a host-plugin author's classpath — `jetwhale-annotations` reaches host-sdk through `jetwhale-protocol:core`'s api dependency. `@OptIn(ExperimentalJetWhaleApi::class)` therefore opted into whichever import happened to be present, silently, since both compile. They also disagreed on retention. The host-sdk copy is removed and its better-specified definition — BINARY retention, an explicit message, narrowed targets — is what the shared one now carries. The internal pair was disambiguated long ago as `InternalJetWhaleApi` and `InternalJetWhaleHostApi`; the experimental pair never was. BREAKING: `com.kitakkun.jetwhale.host.sdk.ExperimentalJetWhaleApi` is gone. Host-plugin authors opting in by that name should import `com.kitakkun.jetwhale.annotations.ExperimentalJetWhaleApi` instead, which arrives transitively and needs no new dependency. Cheap now, expensive after 1.0.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR consolidates the project’s experimental opt-in annotation into a single shared definition (jetwhale-annotations) to prevent ambiguous opt-ins for plugin authors, fixes a real concurrency defect in Apple host discovery, and performs a repo-wide warning sweep (Compose/Gradle/KMP/OkHttp/deprecation cleanups).
Changes:
- Remove
com.kitakkun.jetwhale.host.sdk.ExperimentalJetWhaleApiand migrate usages tocom.kitakkun.jetwhale.annotations.ExperimentalJetWhaleApi. - Fix a data race in Apple mDNS discovery result collection; update Android discovery to handle API 34’s
hostAddresses. - Mechanical warning fixes across build scripts and UI code (KMP
js(IR)deprecation, Material3Secondary*TabRow,ExposedDropdownMenuAnchorType, etc.).
Reviewed changes
Copilot reviewed 57 out of 57 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
test-annotations/build.gradle.kts |
Adds module-scoped -Xexpect-actual-classes compiler flag for the expect/actual annotation use case. |
jetwhale-plugins/semantics/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/semantics/host/PerformNodeActionCommand.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/semantics/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/semantics/host/GetNodeTreeCommand.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/semantics/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/semantics/host/FindNodesCommand.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/semantics/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/semantics/host/ComposeSemanticsInspectorPluginFactory.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/semantics/agent/build.gradle.kts |
Migrates deprecated js(IR) DSL usage to js { ... }. |
jetwhale-plugins/network/host/src/test/kotlin/com/kitakkun/jetwhale/plugins/network/host/NetworkMcpCommandsTest.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/network/host/src/test/kotlin/com/kitakkun/jetwhale/plugins/network/host/McpParameterDslTest.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/network/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/network/host/TrafficView.kt |
Replaces deprecated TabRow with SecondaryTabRow to match updated Material3 APIs. |
jetwhale-plugins/network/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/network/host/SetMockRulesCommand.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/network/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/network/host/SetMockingEnabledCommand.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/network/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/network/host/RemoveMockRuleCommand.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/network/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/network/host/NetworkInspectorScreen.kt |
Replaces deprecated TabRow with SecondaryTabRow. |
jetwhale-plugins/network/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/network/host/NetworkHostPluginFactory.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/network/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/network/host/MocksView.kt |
Updates deprecated MenuAnchorType to ExposedDropdownMenuAnchorType. |
jetwhale-plugins/network/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/network/host/ListTransactionsCommand.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/network/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/network/host/GetTransactionCommand.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/network/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/network/host/GetMockConfigCommand.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/network/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/network/host/ClearTransactionsCommand.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/network/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/network/host/AddMockRuleCommand.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/network/agent-okhttp/src/test/kotlin/com/kitakkun/jetwhale/plugins/network/agent/okhttp/JetWhaleNetworkOkHttpInterceptorTest.kt |
Removes unnecessary null-assertions on OkHttp Response.body (now non-null in the used API). |
jetwhale-plugins/nav3/host/src/test/kotlin/com/kitakkun/jetwhale/plugins/nav3/host/Nav3McpCommandsTest.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/nav3/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/nav3/host/ReplaceBackStackCommand.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/nav3/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/nav3/host/RemoveNavKeyCommand.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/nav3/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/nav3/host/PushNavKeyCommand.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/nav3/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/nav3/host/PopBackStackCommand.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/nav3/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/nav3/host/Nav3NavigatorScreen.kt |
Replaces deprecated ScrollableTabRow with SecondaryScrollableTabRow. |
jetwhale-plugins/nav3/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/nav3/host/Nav3HostPluginFactory.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/nav3/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/nav3/host/Nav3BackStackController.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/nav3/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/nav3/host/MoveNavKeyToTopCommand.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/nav3/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/nav3/host/ListNavKeyTypesCommand.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/nav3/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/nav3/host/GetBackStackCommand.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/example/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/example/host/ExampleHostPluginFactory.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-plugins/example/host/src/main/kotlin/com/kitakkun/jetwhale/plugins/example/host/ExampleHeadlessPluginFactory.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-host/feature/settings/src/main/kotlin/com/kitakkun/jetwhale/host/settings/plugin/MavenPluginInstallDialog.kt |
Updates deprecated MenuAnchorType to ExposedDropdownMenuAnchorType. |
jetwhale-host/core/mcp/src/test/kotlin/com/kitakkun/jetwhale/host/mcp/McpToolRegistryTest.kt |
Updates opt-in annotation import to the shared jetwhale-annotations FQN. |
jetwhale-host/core/mcp/build.gradle.kts |
Updates module-wide opt-in compiler arg to the new annotation FQN. |
jetwhale-host/core/data/src/main/kotlin/com/kitakkun/jetwhale/host/data/plugin/DefaultPluginFactoryRepository.kt |
Adjusts Metro @Inject placement to match the project’s injection style. |
jetwhale-host/app/src/main/kotlin/com/kitakkun/jetwhale/host/drawer/McpToolsScreen.kt |
Replaces deprecated TabRow with SecondaryTabRow. |
jetwhale-host/app/build.gradle.kts |
Writes out Compose Desktop dependency coordinates instead of deprecated compose.desktop.<platform> accessors. |
jetwhale-host-sdk/src/test/kotlin/com/kitakkun/jetwhale/host/sdk/McpJsonSchemaTest.kt |
Consolidates opt-ins via file-level @OptIn, including the moved experimental annotation. |
jetwhale-host-sdk/src/main/kotlin/com/kitakkun/jetwhale/host/sdk/McpJsonSchema.kt |
Moves repeated @OptIn(ExperimentalSerializationApi) to a file-level opt-in. |
jetwhale-host-sdk/src/main/kotlin/com/kitakkun/jetwhale/host/sdk/JetWhaleMcpCommand.kt |
Imports and applies the shared @ExperimentalJetWhaleApi to the MCP command surface. |
jetwhale-host-sdk/src/main/kotlin/com/kitakkun/jetwhale/host/sdk/JetWhaleMcpCapablePlugin.kt |
Imports and applies the shared @ExperimentalJetWhaleApi to plugin-facing MCP types. |
jetwhale-host-sdk/src/main/kotlin/com/kitakkun/jetwhale/host/sdk/DefaultArgumentJson.kt |
Imports the shared experimental annotation (supporting the unified opt-in model). |
jetwhale-host-sdk/src/main/kotlin/com/kitakkun/jetwhale/host/sdk/ExperimentalJetWhaleApi.kt |
Removes the host-sdk-local public experimental annotation (breaking change per PR description). |
jetwhale-host-sdk/api/jetwhale-host-sdk.api |
Updates ABI surface to reflect removal of the host-sdk annotation type. |
jetwhale-gradle-plugin/src/main/kotlin/com.kitakkun.jetwhale.host.gradle.kts |
Removes deprecated Configuration.isVisible assignment. |
jetwhale-annotations/src/commonMain/kotlin/com/kitakkun/jetwhale/annotations/ExperimentalJetWhaleApi.kt |
Becomes the single project-wide definition of ExperimentalJetWhaleApi (message/targets/retention). |
jetwhale-agent-runtime/src/jvmTest/kotlin/com/kitakkun/jetwhale/agent/runtime/MessagingServiceResolutionTest.kt |
Adds file-level opt-in to silence experimental coroutines API warnings in tests. |
jetwhale-agent-runtime/src/appleMain/kotlin/com/kitakkun/jetwhale/agent/runtime/HostDiscovery.apple.kt |
Fixes discovery result collection race by using an AtomicReference to an immutable list. |
jetwhale-agent-runtime/src/androidMain/kotlin/com/kitakkun/jetwhale/agent/runtime/HostDiscovery.android.kt |
Uses hostAddresses on API 34+ while retaining deprecated host below 34 with suppression. |
gradle-conventions/src/main/kotlin/multiplatform.gradle.kts |
Migrates deprecated js(IR) DSL usage to js { ... } in shared conventions. |
demo/web/build.gradle.kts |
Migrates deprecated js(IR) DSL usage to js { ... }. |
demo/shared/src/commonMain/kotlin/com/kitakkun/jetwhale/demo/shared/App.kt |
Replaces deprecated TabRow with SecondaryTabRow. |
demo/shared/src/androidMain/kotlin/com/kitakkun/jetwhale/demo/shared/PlatformExtraTab.android.kt |
Removes unnecessary safe-calls on OkHttp Response.body in demo networking. |
demo/shared/build.gradle.kts |
Migrates deprecated js(IR) DSL usage to js { ... }. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Three commits, reviewable separately. The middle and last are not warnings — they came out of the release-readiness QA — and the last one removes a public annotation, so it leads here.
refactor!— oneExperimentalJetWhaleApifor the projectThere were two, sharing a simple name, and both on a host-plugin author's classpath:
jetwhale-annotationsreachesjetwhale-host-sdkthroughjetwhale-protocol:core'sapidependency.@OptIn(ExperimentalJetWhaleApi::class)therefore opted into whichever import happened to be present — silently, because both compile. They also disagreed on retention (BINARY vs RUNTIME).Breaking:
com.kitakkun.jetwhale.host.sdk.ExperimentalJetWhaleApiis gone. Importcom.kitakkun.jetwhale.annotations.ExperimentalJetWhaleApiinstead; it arrives transitively, so no new dependency. The surviving definition is the host-sdk one's — BINARY retention, an explicit message, narrowed targets — moved to the shared module.The internal pair was disambiguated long ago as
InternalJetWhaleApi/InternalJetWhaleHostApi. The experimental pair never was. Cheap now, expensive after 1.0.fix— the Apple discovery results were racedHostDiscovery.apple.ktappended to a plainMutableListfrom the main run loop while reading it from whatever thread the coroutine resumed on once the timeout expired — and the browser is still live at that moment, since cancellation only dispatches the stop to the main queue. Android's actual has used a synchronized list for exactly this all along.An
AtomicReferencerather than a lock: appends come from the main queue alone, so there is a single writer and read-then-store needs no CAS loop. Only the visibility was missing.chore— the warningsResponse.body?.in the demo, three!!in the interceptor testsMcpJsonSchemaNsdServiceInfo.hosthostAddresses, minSdk is 23 → chosen at runtime. Taking the first of the list is whathostdocumented itself to return, so the branches agree rather than merely both compilingTabRow/ScrollableTabRowSecondary*variants, which keep the full-width indicator.Primary*would also have restyled the tabsMenuAnchorTypeExposedDropdownMenuAnchorType, matching whatSessionSelectorViewalready usedcompose.desktop.<platform>js(IR),Configuration.isVisible,@Injectplacement-Xexpect-actual-classestest-annotationsalone, the one module declaring an expect/actual annotation. KT-61573 asks you to acknowledge Beta; this is not a way of hiding itDeliberately left:
LocalClipboardManagerCompose Multiplatform 1.11.1 offers no plain-text helper on the replacement — migrating means writing AWT
StringSelectionhandling into four Compose screens, against an API whose own shape is still moving. Not a trade worth making in a release window for a deprecation that works.Verification
./gradlew spotlessCheck check— BUILD SUCCESSFUL, 0 errors. Judged from the build log rather than the exit code; an earlier run reported success while the log said otherwise.Two mistakes of mine that the build caught, recorded because they shaped the diff:
host.sdkannotation back on disk while the commit claimed to remove it.checkKotlinAbifailed on the mismatch.jetwhale-host/core/mcp/build.gradle.ktsopted in by the removed FQN, so deleting the annotation silently disabled the opt-in and produced 164 warnings in that module. I first measured this as pre-existing — the comparison was taken against a tree that already had the deletion committed, so it was no baseline at all. Re-measured against the module directly: 164 → 0 once the FQN was updated.Warning sweep caveat: the final run was largely incremental, so cached compilations contributed no warnings. The known remainder is the three clipboard sites above.