weiqingy opened a new pull request, #548:
URL: https://github.com/apache/flink-agents/pull/548
<!--
* 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: #547
### Purpose of change
<!-- What is the purpose of this change? -->
`AgentPlan` (624 lines) mixes plan definition, resource caching/resolution,
Python bridge wiring, and serialization.
This PR extracts two classes to separate concerns:
- **`ResourceCache`** — lazy resource resolution, caching, and cleanup.
Created by the operator in `open()`, owned by
the operator lifecycle.
- **`PythonResourceBridge`** — static `discoverPythonMCPResources()` for
Python MCP tool/prompt discovery. Called
during operator init.
After extraction, `AgentPlan` becomes immutable after construction (~490
lines, down from 624). The removed public
methods are `getResource()`, `close()`, and `setPythonResourceAdapter()`.
### Tests
<!-- How is this change verified? -->
- `mvn test -pl plan` — all plan module tests pass
- `mvn test -pl runtime` — all runtime module tests pass
- `./tools/lint.sh -c` — formatting check passed
- `./tools/ut.sh -j` — full Java test suite passed
### API
<!-- Does this change touches any public APIs? -->
Yes. Three public methods removed from `AgentPlan`:
- `getResource(String, ResourceType)` — replaced by
`ResourceCache.getResource()`
- `close()` — replaced by `ResourceCache.close()`
- `setPythonResourceAdapter(PythonResourceAdapter)` — replaced by
`PythonResourceBridge.discoverPythonMCPResources()`
### 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 -->
--
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]