[hotfix] Register all resource types added via Agent.addResource#671
Merged
wenjin272 merged 1 commit intoMay 14, 2026
Merged
Conversation
…che#668) Previously the AgentPlan constructor only created providers for CHAT_MODEL and CHAT_MODEL_CONNECTION entries added via Agent.addResource(...); resources of other types (EMBEDDING_MODEL, EMBEDDING_MODEL_CONNECTION, VECTOR_STORE, MCP_SERVER) were silently dropped because the if/else chain had no branch for them. Invert the branching so PROMPT and TOOL keep their special handling and every other type flows through the Python/Java ResourceProvider path. Reject non-ResourceDescriptor values up front with a clear IllegalStateException instead of letting the cast throw ClassCastException. MCP_SERVER cannot be registered through this path because tools/prompts are discovered by extractJavaMCPServer; reject it with a message that points users at the @MCPSERVER annotation. (cherry picked from commit 064341a)
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.
Purpose of change
Register all resource types added via Agent.addResource
Tests
UT
API
No
Documentation
doc-neededdoc-not-neededdoc-included