Skip to content

[hotfix] Register all resource types added via Agent.addResource#671

Merged
wenjin272 merged 1 commit into
apache:release-0.2from
GreatEugenius:hotfix-get-resource-0.2
May 14, 2026
Merged

[hotfix] Register all resource types added via Agent.addResource#671
wenjin272 merged 1 commit into
apache:release-0.2from
GreatEugenius:hotfix-get-resource-0.2

Conversation

@GreatEugenius
Copy link
Copy Markdown
Collaborator

Purpose of change

Register all resource types added via Agent.addResource

Tests

UT

API

No

Documentation

  • doc-needed
  • doc-not-needed
  • doc-included

…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)
@github-actions github-actions Bot added doc-not-needed Your PR changes do not impact docs fixVersion/0.2.2 priority/major Default priority of the PR or issue. labels May 14, 2026
@GreatEugenius GreatEugenius requested a review from wenjin272 May 14, 2026 09:03
@wenjin272 wenjin272 merged commit e4886af into apache:release-0.2 May 14, 2026
42 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs fixVersion/0.2.2 priority/major Default priority of the PR or issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants