Skip to content

Conversation

@sdubov
Copy link
Contributor

@sdubov sdubov commented Oct 26, 2025

KG-505. Move Debugger feature to the agents-core

  • Move Debugger feature from agents-features module into agents-core module to get access to the feature from the core agents flow and be able to install a feature through an external agent configuration.
  • Add a list of system features (Debugger) that can be installed through agent configuration parameters;
  • Add agent logic to read a system property and set up Debugger feature with a provided config.

Motivation and Context

Debugger feature is essential for a debugging capabilities. It would be necessary to have it in agents-core to enable the functionality upon request.

This is also allows to install debugger feature upon request by a plugins, e.g. "AI Debugger" that can set the Debugger feature via VM options instead of requesting this from a user.

Breaking Changes

Yes

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

@sdubov sdubov requested a review from Ololoshechkin October 26, 2025 18:40
@sdubov sdubov self-assigned this Oct 26, 2025
@sdubov sdubov added refactoring Code improvements that enhance structure, readability, and quality without changing functionality dependencies Update dependencies labels Oct 26, 2025
@sdubov sdubov force-pushed the sdubov/KG-505 branch 8 times, most recently from aeee620 to b2685ce Compare October 27, 2025 16:37
@github-actions
Copy link

github-actions bot commented Oct 27, 2025

Qodana for JVM

17426 new problems were found

Inspection name Severity Problems
Unused import directive 🔶 Warning 16213
Check Kotlin and Java source code coverage 🔶 Warning 1200
Missing KDoc for public API declaration 🔶 Warning 11
If-Null return/break/... foldable to '?:' ◽️ Notice 2
@@ Code coverage @@
+ 70% total lines covered
15997 lines analyzed, 11318 lines covered
# Calculated according to the filters of your coverage tool

☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

@sdubov sdubov requested a review from EugeneTheDev October 27, 2025 17:53
Copy link
Collaborator

@EugeneTheDev EugeneTheDev left a comment

Choose a reason for hiding this comment

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

While I understand the reason why this change was made - we want to always ensure that Debugger is installed - I have some concerns regarding the implementation. Specifically, moving feature implementation to the core, as it kinda obscures the border between core and non-core.

I have an alternative proposal. What if we go another way, and move some stuff out of the core, to make it lighter and leave truly "core" functionality in there. Namely, I'm suggesting to move GraphAIAgent and FunctionalAIAgent with AgentService to a separate module(s). It would give us a number of benefits and would work as follows:

  1. Keeping the core lean without bringing specific implementation details. Only truly "core" functionality is left in core, and concrete implementations leave in dedicated modules.
  2. You get to keep debugger with all its logic in a separate module, as before, making its development more isolated and easier. Faster compilation and no unnecesary clashes and conflicts with changes in core.
  3. To still ensure that debugger is always installed in the agents we provide, we just add an explicit dependency in module with concrete agent implementations that we moved out of the core before on the debugger feature, and install it explicitly, like any other feature. We can safely do this now, since it's a separate module and there won't be circular dependencies.

IMHO such solution would look cleaner and ensure better structure. Please let me know what you think, and let's maybe discuss it in more details.

/**
* A set containing the keys of all registered features.
*/
public val features: Set<AIAgentStorageKey<*>>
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is basically a duplicate of a registeredFeatures, so it is doubtful that a separate property is needed. And it is used in tests only, so shouldn't it be removed?

Copy link
Contributor Author

@sdubov sdubov Oct 27, 2025

Choose a reason for hiding this comment

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

True, this was added for the test purpose, but there is a reason for that. registeredFeatures is protected and store a feature and feature config. If I make this public, the config will be exposed to public as well. It means that you can modify the config outside of the install(MyFeature) { ... } lambda which I did not want to break the current design.

It might be that we want to expose this, and, I can imagine, that this can be helpful in some cases. For example, when you want to spread the control for the feature config. I would propose to discuss this topic separately.

Copy link
Collaborator

@Ololoshechkin Ololoshechkin left a comment

Choose a reason for hiding this comment

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

Let's just mark Debugger as InternalAgentApi with OptIn, or -- create a new OptIn annotation with a warning that it's experimental API and might be changed.

Maybe call it ExperimentalKoogAPI :)

- Move Debugger feature from agents-features module into agents-core module to get access to the feature from the core agents flow and be able to install a feature through an external agent configuration.
- Add a list of system features (Debugger) that can be installed through agent configuration parameters;
- Add agent logic to read a system property and set up Debugger feature with a provided config;
- Add tests to check updates in an agent pipeline logic.
@sdubov sdubov force-pushed the sdubov/KG-505 branch 2 times, most recently from 9fbbd99 to 465ef2b Compare October 28, 2025 17:45
@sdubov sdubov merged commit e23c4e9 into develop Oct 28, 2025
10 checks passed
@sdubov sdubov deleted the sdubov/KG-505 branch October 28, 2025 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Update dependencies refactoring Code improvements that enhance structure, readability, and quality without changing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants