Add multi-model provider support and an agents page#70
Open
arefbehboudi wants to merge 11 commits into
Open
Conversation
- Named LLM providers under `agent.llm.providers` (LlmProviderProperties) with a per-provider ChatModelFactory SPI (OpenAI, Anthropic incl. Claude Code OAuth, Ollama, Google Gen AI) and a ChatClientRegistry that builds/caches a ChatClient per provider and rebuilds on configuration refresh. - Hot-reload of configuration without a full restart (ConfigurationRebinder + ConfigurationRefreshedEvent; ConfigurationManager now tracks changed keys and supports removeProperty). - Main agent ChatClient delegates to the default provider and rebuilds on refresh (MainChatClientProvider + DelegatingChatClient); subagent routing wired via the agent-utils TaskTool. - Agents page + REST API (/api/agents): create/edit/delete agents; structured config (provider type, model, API key) is saved to application.yaml under agent.llm.providers.<name>, and description + instructions to workspace/agents/<name>.md. - ProviderConnectionTester + /api/providers REST; onboarding now saves the selected provider as providers.default. - Tests for registry fallback, connection tester, and the agent/provider controllers. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
66a4475 to
dc6e9a6
Compare
- Consolidate all workspace/agents/ access into SubagentStore and remove the duplicate SubagentReferenceScanner (single frontmatter parser). - Route subagents by provider name only in MainChatClientProvider; drop the redundant provider-type builder keying and its LlmProviderProperties dependency. - Trim ProviderController to a read-only GET (used for the agents-page model list); remove the unused ProviderForm. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Drop the /api/providers controller, DTO, and test, and simplify the agents page to default the model field from the selected provider instead of populating it from the configured provider list. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Remove the provider-change-only early return so any configuration change triggers a full application restart.
Configuration changes trigger a full application restart, so the delegating chat client and the configuration rebind/refresh machinery are no longer needed. Remove DelegatingChatClient, ConfigurationRebinder and ConfigurationRefreshedEvent, and build the main chat client and provider registry once per context.
The agents page mapping was lost when SettingsController was removed; serve the view from IndexController so the page renders again.
Onboarding writes the provider under agent.llm.providers.default, not spring.ai.model.chat, so the index redirect never saw a configured model. Gate on the default provider entry instead.
Onboarding stores the provider under agent.llm.providers.default, so the session fallbacks that read spring.ai.model.chat never pre-selected the configured provider. Read the default provider entry instead.
The credentials step read and displayed spring.ai.<id>.* keys, but onboarding saves under agent.llm.providers.default. Read and show the actual keys, and drop the now-unused createPropertyKey/saveProperty helpers.
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.
Named LLM providers under
agent.llm.providers(LlmProviderProperties) with a per-provider ChatModelFactory SPI (OpenAI, Anthropic incl. Claude Code OAuth, Ollama, Google Gen AI) and a ChatClientRegistry that builds/caches a ChatClient per provider and rebuilds on configuration refresh.Hot-reload of configuration without a full restart (ConfigurationRebinder + ConfigurationRefreshedEvent; ConfigurationManager now tracks changed keys and supports removeProperty).
Main agent ChatClient delegates to the default provider and rebuilds on refresh (MainChatClientProvider + DelegatingChatClient); subagent routing wired via the agent-utils TaskTool.
Agents page + REST API (/api/agents): create/edit/delete agents; structured config (provider type, model, API key) is saved to application.yaml under agent.llm.providers., and description + instructions to workspace/agents/.md.
ProviderConnectionTester + /api/providers REST; onboarding now saves the selected provider as providers.default.
Tests for registry fallback, connection tester, and the agent/provider controllers.
Closes #28