KEMBAR78
Add iOS target for demo-compose-app by siarhei-luskanau · Pull Request #779 · JetBrains/koog · GitHub
Skip to content

Conversation

siarhei-luskanau
Copy link
Contributor

@siarhei-luskanau siarhei-luskanau commented Sep 10, 2025

Motivation and Context

Breaking Changes


Type of the changes

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tests improvement
  • Refactoring

Checklist

  • The pull request has a description of the proposed change
  • I read the Contributing Guidelines before opening the pull request
  • The pull request uses develop as the base branch
  • Tests for the changes have been added
  • All new and existing tests passed
Additional steps for pull requests adding a new feature
  • An issue describing the proposed change exists
  • The pull request includes a link to the issue
  • The change was discussed and approved in the issue
  • Docs have been added / updated

@siarhei-luskanau
Copy link
Contributor Author

siarhei-luskanau commented Sep 10, 2025

iOS target has network issue. Looks like CIO engine is used instead of Darwin engine for iOS target.

Simulator Screenshot - iPhone 16 - 2025-09-10 at 13 06 32
ai.koog.agents.core.exception.UnexpectedServerException: TLS sessions are not supported on Native platform.
    at 0   Koog Demo App.debug.dylib           0x10a07f00f        kfun:kotlin.Throwable#<init>(kotlin.String?){} + 99 
    at 1   Koog Demo App.debug.dylib           0x10a078cbb        kfun:kotlin.Exception#<init>(kotlin.String?){} + 95 
    at 2   Koog Demo App.debug.dylib           0x10a078e8b        kfun:kotlin.RuntimeException#<init>(kotlin.String?){} + 95 
    at 3   Koog Demo App.debug.dylib           0x10b952703        kfun:ai.koog.agents.core.exception.AgentRuntimeException#<init>(kotlin.String){} + 95 
    at 4   Koog Demo App.debug.dylib           0x10b952777        kfun:ai.koog.agents.core.exception.AgentEngineException#<init>(kotlin.String){} + 95 
    at 5   Koog Demo App.debug.dylib           0x10b9527eb        kfun:ai.koog.agents.core.exception.UnexpectedServerException#<init>(kotlin.String){} + 95 

@kpavlov
Copy link
Collaborator

kpavlov commented Sep 11, 2025

@siarhei-luskanau the CIO issue was fixed and it's available in the nightly build. I pushed the update and tada: 🎉
Simulator Screenshot - iPhone 16 Pro - 2025-09-11 at 11 02 19


// Define keys for the preferences
companion object {
val OPENAI_TOKEN_KEY = stringPreferencesKey("openai_token")
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit/note: This should normakky be stored in KeyChain. I found the Multiplatform Settings library supports it. Maybe there is a more idiomatic way to support it without adding this dependency.
It's not blocker now

@kpavlov kpavlov added the enhancement New feature or request label Sep 11, 2025
@kpavlov
Copy link
Collaborator

kpavlov commented Sep 11, 2025

@siarhei-luskanau , what if we'll align the build pipeline with existing one? I'm looking forward merging this PR

@siarhei-luskanau
Copy link
Contributor Author

@siarhei-luskanau , what if we'll align the build pipeline with existing one? I'm looking forward merging this PR

@kpavlov I'm ready to do this. Can we make a call to discuss about pipeline and expected result?

@kpavlov
Copy link
Collaborator

kpavlov commented Sep 11, 2025

@siarhei-luskanau My schedule is quite tight, so I can’t join a call.
Regarding the expectations: we are running build on macos-latest runner. For simplicity, it's ok to start with assembling the app for all platforms on this agent.

@siarhei-luskanau siarhei-luskanau force-pushed the example-compose-ios branch 2 times, most recently from fd7fd85 to 6876c22 Compare September 12, 2025 05:12
@siarhei-luskanau
Copy link
Contributor Author

@siarhei-luskanau My schedule is quite tight, so I can’t join a call. Regarding the expectations: we are running build on macos-latest runner. For simplicity, it's ok to start with assembling the app for all platforms on this agent.

I have added Demo Compose app to the root Gradle project. As result demo app project can open and launched as part of root Gradle project and as independent project. Additional a have updated the checks.yml pipeline to build Demo Compose app as part of root Gradle project

@siarhei-luskanau siarhei-luskanau force-pushed the example-compose-ios branch 3 times, most recently from f4b3954 to c597d63 Compare September 12, 2025 06:29
@siarhei-luskanau
Copy link
Contributor Author

@siarhei-luskanau My schedule is quite tight, so I can’t join a call. Regarding the expectations: we are running build on macos-latest runner. For simplicity, it's ok to start with assembling the app for all platforms on this agent.

I have added Demo Compose app to the root Gradle project. As result demo app project can open and launched as part of root Gradle project and as independent project. Additional a have updated the checks.yml pipeline to build Demo Compose app as part of root Gradle project

I was wrong, I didn't managed to add Demo Compose app to the root Gradle project.

@siarhei-luskanau
Copy link
Contributor Author

@kpavlov Do you mind to keep the demo app assembling in checks.yml only and remove the demo-compose-app.yml?

@kpavlov
Copy link
Collaborator

kpavlov commented Sep 12, 2025

@kpavlov Do you mind to keep the demo app assembling in checks.yml only and remove the demo-compose-app.yml?

@siarhei-luskanau , maybe not, unless we a publishing koog to mavenLocal and consume it from demo app. The macos builds are pretty slow. The CI is already slow enough ...

@siarhei-luskanau
Copy link
Contributor Author

@kpavlov Do you mind to keep the demo app assembling in checks.yml only and remove the demo-compose-app.yml?

@siarhei-luskanau , maybe not, unless we a publishing koog to mavenLocal and consume it from demo app. The macos builds are pretty slow. The CI is already slow enough ...

@kpavlov Now he have the same work in two pipelines related the the demo app assembling.
checks.yml and demo-compose-app.yml do the same tasks.
I think it is better to remove pipeline work duplication to save CI time

@siarhei-luskanau siarhei-luskanau marked this pull request as ready for review September 13, 2025 06:25
@kpavlov
Copy link
Collaborator

kpavlov commented Sep 13, 2025

@siarhei-luskanau , as far as I remember, "checks" doesn't build the demo app, and demo app workflow doesn't build main project. So we should be good

@siarhei-luskanau
Copy link
Contributor Author

Rebased to the latest develop branch and squashed into one commit

@siarhei-luskanau
Copy link
Contributor Author

@kpavlov Updated demo app dependencies to use compose multiplatform 1.9.0.
I have tried to apply koog = "0.4.2" and there was an issue on android target:

Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class io.modelcontextprotocol.kotlin.sdk.LibVersionKt found in modules kotlin-sdk-client-jvm-0.7.0.jar -> kotlin-sdk-client-jvm-0.7.0 (io.modelcontextprotocol:kotlin-sdk-client-jvm:0.7.0) and kotlin-sdk-core-jvm-0.7.0.jar -> kotlin-sdk-core-jvm-0.7.0 (io.modelcontextprotocol:kotlin-sdk-core-jvm:0.7.0)

kpavlov
kpavlov previously approved these changes Sep 18, 2025
Copy link
Collaborator

@kpavlov kpavlov left a comment

Choose a reason for hiding this comment

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

Thank you, @siarhei-luskanau

@kpavlov kpavlov self-requested a review September 18, 2025 08:44
@kpavlov kpavlov dismissed their stale review September 18, 2025 09:29

It works on iOS, but there is an error on Android

@siarhei-luskanau
Copy link
Contributor Author

@kpavlov I have updated the PR:

  • Rebased to the latest develop branch and squashed into one commit.
  • Updated koog version to "0.4.2".
  • Fix Android target issue "Duplicate class io.modelcontextprotocol.kotlin.sdk.LibVersionKt" by updating the koog dependencies to "ai.koog:agents-core" and "ai.koog:prompt-executor-llms-all".

Jvm, Android, iOS target works as expected for me locally.

Copy link
Collaborator

@kpavlov kpavlov left a comment

Choose a reason for hiding this comment

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

Thank you, @siarhei-luskanau 🙏🏻
Verified, works for me too

@siarhei-luskanau
Copy link
Contributor Author

@kpavlov Please keep in mind that I have two additional PR related the demo-compose-app:

@kpavlov kpavlov merged commit eaabdfa into JetBrains:develop Sep 22, 2025
10 of 11 checks passed
@siarhei-luskanau siarhei-luskanau deleted the example-compose-ios branch September 22, 2025 11:46
karloti pushed a commit to karloti/koog that referenced this pull request Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants