da-daken opened a new pull request, #1453: URL: https://github.com/apache/flink-agents/pull/1453
Linked issue: #1452 ### Purpose of change A Java-loaded YAML document could declare `type: java` for `decision_model_connections` or `decision_model_setups`. The loader accepted the declaration even though decision models have no Java implementation, then failed later while constructing the resource. Invalid configuration now fails in `YamlLoader.buildDescriptor` with the same message as the Python loader, e.g. `type='java' is not supported for decision_model`. The descriptor builder now has explicit supported resource-kind sets for each language. Python declarations retain their existing supported set; Java declarations are limited to resource kinds with a Java implementation usable through YAML: chat models and connections, embedding models and connections, vector stores, model routers, and agents. ### Behavioral Semantics #### Behavioral contracts 1. A `decision_model_connections` entry with `type: java` raises `IllegalArgumentException` during YAML loading with `type='java' is not supported for decision_model_connection`. 2. A `decision_model_setups` entry with `type: java` raises `IllegalArgumentException` during YAML loading with `type='java' is not supported for decision_model`. 3. Python decision-model declarations remain accepted, including aliases resolved to Python implementations. 4. Java declarations for chat models, embedding models, vector stores, model routers, and external sub-agents remain accepted. #### Failure behavior Invalid descriptor language/resource-kind combinations fail at YAML load time. No invalid Java descriptor is silently created for a later class lookup. ### Tests New tests in `YamlLoaderBuildersTest` cover both decision-model resource kinds at the helper boundary. A parameterized `YamlLoaderBuildAgentsTest` case covers both YAML sections through `YamlLoader.buildAgents(Path)`. Targeted result: `mvn --batch-mode -pl api -DskipTests=false -Dtest=YamlLoaderBuildersTest,YamlLoaderBuildAgentsTest,YamlSubagentTest,YamlModelRouterLoaderTest test` passed (67 tests). Full API module result: `mvn --batch-mode -pl api test` passed (944 tests, 16 skipped). Spotless passed using JDK 11. ### API No public API signature changes. The new rejection makes a previously accepted invalid YAML configuration fail at load time. ### Documentation - [ ] `doc-needed` - [x] `doc-not-needed` - [ ] `doc-included` The YAML reference already states that decision providers have only Python implementations and that Python-loaded YAML cannot use Java implementations. ### Was this patch authored or co-authored using generative AI tooling? - [x] Yes - [ ] No Generated-by: OpenAI Codex (GPT-5.1) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
