Repository navigation
Conversation
The Java YAML loader now validates both descriptor languages against an explicit supported resource-kind set. This rejects type=java for Python-only decision-model resources at load time instead of producing an invalid Java descriptor. Generated-by: OpenAI Codex (GPT-5.1)
Decision models have Java extension points, so type=java remains valid for both decision-model sections. Replace the language-only rejection with coverage for custom Java implementations. Generated-by: OpenAI Codex (GPT-5.1)
da-daken
force-pushed
the
codex/fix-java-yaml-decision-model-type
branch
from
November 25, 2026 11:09
56faf0d to
f827662
Compare
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.
Linked issue: #1452
Purpose of change
The Java YAML loader only checked supported resource kinds for
type: python. Thetype: javabranch passed every kind through, so a Python-only section such asmcp_serverscould become a Java descriptor whose class was the unresolved short alias. That failed later during resource construction instead of during YAML loading.YamlLoader.buildDescriptornow selects an explicit supported-kind set for both languages. Decision models stay in the Java set because they support custom Java implementations; Python-only YAML sections are rejected on the Java path.Runtime flow:
buildDescriptorreadstype, defaulting to Python.IllegalArgumentExceptionwith the language and resource kind.Behavioral Semantics
Interaction decisions
mcp_serverswithtype: javadecision_model_setupswithtype: javaand a custom Java classdecision_model_connectionswithtype: javaand a custom Java classchat_model_*,embedding_model_*,vector_stores,model_routerswithtype: javatype: pythondeclarationsBehavioral contracts
type: javafails during loading withtype='java' is not supported for <resource kind>.Failure behavior
Unsupported language/resource-kind combinations raise
IllegalArgumentExceptionfromYamlLoader.buildDescriptor. This prevents an unresolved short alias from surviving as a Java class name and failing later. A fully-qualified class that is absent from the runtime classpath still fails when the resource is constructed, because the loader does not load classes merely to validate YAML.Tests
YamlLoaderBuildAgentsTest(MCP coverage)buildAgents(Path)YamlLoaderBuildAgentsTest.decisionModelJavaDeclarationsLoadCustomImplementationsYamlLoaderBuildersTest.descriptorJavaSupportsCustomDecisionImplementationsCoverage by risk: the tests exercise the descriptor helper and both decision-model sections through
buildAgents(Path). Not verified: constructing a custom Java decision model from the YAML result; programmatic decision-model registration is covered byAgentPlanDeclareDecisionModelTest.Targeted tests: 81 passed. Full API module: 944 tests, 0 failures, 16 skipped. Spotless passed using JDK 11.
API
No public API signature changes. The observable behavior is earlier rejection of invalid
type: javadeclarations for Python-only resource kinds.Documentation
doc-neededdoc-not-neededdoc-includedThe behavior agrees with the existing YAML language-support table.
Was this patch authored or co-authored using generative AI tooling?
Generated-by: OpenAI Codex (GPT-5.1)