Skip to content

Lazily initialise KotlinAIAgent #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed

Lazily initialise KotlinAIAgent #4

wants to merge 4 commits into from

Conversation

nomisRev
Copy link
Contributor

@nomisRev nomisRev commented May 6, 2025

There were 2 usages of the cs: CoroutineScope parameter:

  1. Install features, and call event handlers, we can remove the need for this by lazily initialing the KotlinAIAgent
  2. Running the agent sessions in a new coroutine, this is only done for init defined in the base class but we can safely use a coroutineScope in the run function.

We can also safely remove isReady from FeatureMessageProcessor while preserving the correct order of initialise, but I'd prefer to do that in a seperate PR.

…nt` and `AIAgent` classes for improved coroutine handling.
nomisRev added 3 commits May 9, 2025 08:26
# Conflicts:
#	agents/agents-core/src/commonMain/kotlin/ai/grazie/code/agents/core/AIAgent.kt
#	agents/agents-local/src/commonMain/kotlin/ai/grazie/code/agents/local/KotlinAIAgent.kt
@nomisRev
Copy link
Contributor Author

Obsolete

@nomisRev nomisRev closed this May 12, 2025
@sproshev sproshev deleted the lazy-init branch May 21, 2025 17:16
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.

3 participants