Zhuoxi2000 opened a new pull request, #1446:
URL: https://github.com/apache/flink-agents/pull/1446

   <!--
   * Thank you very much for contributing to Flink Agents.
   * Please add the relevant components in the PR title. E.g., [api], 
[runtime], [java], [python], [hotfix], etc.
   -->
   
   <!-- Please link the PR to the relevant issue(s). Hotfix doesn't need this. 
-->
   Linked issue: #1445
   
   ### Purpose of change
   
   The YAML reference marks a tool's `parameter_types` as forbidden for Python 
tools. #804 enforced that in the Python loader; the Java `YamlLoader.buildTool` 
still accepted it and dropped the list. It now raises the same error as the 
Python loader, and the `ToolSpec` Javadoc states the rule.
   
   ### Behavioral Semantics
   
   <!-- For a non-trivial code change whose implementation is largely 
AI-assisted: interaction decisions, behavioral contracts, and failure behavior. 
See `contribution-guides/ai-assisted-pr.md`. Remove this heading and this 
comment otherwise. -->
   
   #### Behavioral contracts
   
   1. A tool with `type: python` or no `type` that declares `parameter_types` 
(including `[]`) fails with `IllegalArgumentException`: "Tool '<name>': 
'parameter_types' is only valid for Java tools."
   2. Java tools are unchanged: `parameter_types` is still required and passed 
through.
   
   ### Tests
   
   New `YamlLoaderBuildersTest.buildToolPythonRejectsParameterTypes` covers 
`type: python`, no `type`, and an empty list; all three fail on main and pass 
with this change. `mvn verify -pl api`: 944 tests, 0 failures, spotless clean. 
Every YAML file in the repo that sets `parameter_types` uses `type: java`.
   
   ### API
   
   No public API change.
   
   ### Documentation
   
   <!-- Do not remove this section. Check the proper box only. -->
   
   - [ ] `doc-needed` <!-- Your PR changes impact docs -->
   - [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-included` <!-- Your PR already contains the necessary 
documentation updates -->
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   <!-- Do not remove this section. Check the proper box only. -->
   
   - [x] Yes
   - [ ] No
   
   If yes, include a `Generated-by: <tool name and version> (<model name and 
version>)` line, for example `Generated-by: Claude Code 2.1.226 (Claude Opus 
4.6)`, in the commit message so it reaches Git history. Repeat the same line 
here for reviewer visibility. See the [ASF generative tooling 
guidance](https://www.apache.org/legal/generative-tooling.html).
   
   Generated-by: Claude Code 2.1.259 (Claude Opus 5.5)
   


-- 
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]

Reply via email to