Skip to content

Conversation

@kawolum
Copy link

@kawolum kawolum commented Nov 10, 2025

This is needed to start an application with custom Spring configuration. AgentStaticLoader will be instantiated as a bean.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @kawolum, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on enhancing the extensibility of the application by adjusting the visibility of a core class. By making AgentStaticLoader public, it can now be seamlessly integrated into Spring-based applications, allowing for more flexible and custom configurations when starting an application.

Highlights

  • Class Visibility: The AgentStaticLoader class has been changed from package-private to public.
  • Spring Integration: This change enables AgentStaticLoader to be instantiated as a Spring bean, facilitating custom Spring configurations for applications.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request makes the AgentStaticLoader class public, which is a necessary change to allow it to be instantiated as a Spring bean in custom configurations. The change is logical and well-justified. I have added one suggestion to also make the class final, which is a best practice for public classes not designed for inheritance.

* then registered as beans via factory methods.
*/
class AgentStaticLoader implements AgentLoader {
public class AgentStaticLoader implements AgentLoader {
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Since this class is now public but does not seem to be designed for inheritance, it's a good practice to declare it as final. This prevents subclassing, making the class's contract clearer and avoiding potential issues if it were to be extended in ways that break its internal invariants. This follows the general Java best practice of designing and documenting for inheritance or else prohibiting it.

Suggested change
public class AgentStaticLoader implements AgentLoader {
public final class AgentStaticLoader implements AgentLoader {

@vorburger
Copy link
Member

@kawolum seeing this PR made me laugh 🤣 and chuckle, and made my day, because we've gone back and forth:

I'm OK with making it public after all. @Doris26 do you have any pro for or con against this?

@vorburger
Copy link
Member

I'm OK with making it public after all. @Doris26 do you have any pro for or con against this?

Having said that... @kawolum can you elaborate a little further on why you need it?

This is needed to start an application with custom Spring configuration. AgentStaticLoader will be instantiated as a bean.

Do you just want to use AgentStaticLoader as is, in a Spring configuration class? Would making it final be OK for you?

Or do you want to sub-class and change it? Then wouldn't it be simpler to just implement AgentLoader yourself?

@kawolum
Copy link
Author

kawolum commented Nov 11, 2025

I am deploying ADK web as a service and I need to implement a /healthcheck path.
I have my own Spring Configuration that adds the health check controller bean and AgentLoader bean. (I also need to add some other beans.)
I am doing something like this to start the server.

SpringApplication app = new SpringApplication(AdkWebServer.class, MyConfiguration.class);
app.run(args);

Okay with making AgentStaticLoader final, but I didn't initially because CompiledAgentLoader is not. I am okay either way.
I currently have a copy of AgentStaticLoader since the current implementation is perfect for my use case.

@kawolum
Copy link
Author

kawolum commented Nov 14, 2025

@vorburger Let me know what you think. I can clean up the commit in the PR afterwards.

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.

2 participants