da-daken opened a new pull request, #1223:
URL: https://github.com/apache/flink-agents/pull/1223

   <!--
   * 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: https://github.com/apache/flink-agents/issues/1193
   
   ### Purpose of change
   
   `ReActAgent` gains a fourth constructor parameter, `skills`, so skills can 
be named where the agent is built
   instead of on the chat model descriptor. Java overloads on `List<String>` 
and `Skills`; Python takes
   `Sequence[str] | Skills | None`. Passing nothing keeps today's behavior.
   
   Names go into a copy of the descriptor's `skills` (descriptor's own first, 
constructor's appended, first
   occurrence kept). A `Skills` object is registered as an agent-level `SKILLS` 
resource plus a
   `skills_sources` marker; `SkillManager` loads it at plan time and `open()` 
resolves the marker into skill
   names via `ResourceContext.resolveSkillNamesForSources`, appending them 
after the explicit skills. A shared
   descriptor is never mutated.
   
   ### Behavioral Semantics
   
   - No `skills`, or an empty `Skills` → the descriptor's list is used as 
declared.
   - Names → combined with the descriptor's own; the `bash` command policy is 
untouched.
   - Non-empty `Skills` → names resolved from its sources at runtime, added 
after the explicit skills.
   - A bare `str` for Python `skills` raises `TypeError`.
   - Ordering: `@Skills`/`@skills` methods merge first (Java by method name, 
Python by declaration order), then
     environment, then agent resources; the later source wins a duplicate name.
   - Degraded paths (unknown source, no skills support, missing marker, `null` 
from the bridge) yield no names
     and no exception; only a marker element Jackson cannot convert raises.
   
   ### Tests
   
   - **Java** — `ReActAgentTest` (constructor form: overlay order, no-op on 
empty/`None`, descriptor not
     mutated, language preserved, `allowed_commands` untouched), 
`ReActAgentSkillsTest` (the `SKILLS` resource
     and its marker, resolved at runtime), `SkillManagerTest` (source spec → 
skill names),
     `BaseChatModelSetupSkillsTest` (the marker survives an `AgentPlan` round 
trip), `JavaResourceAdapterTest`
     (bridge conversion and delegation), `AgentPlanDeclareSkillsTest` (merge 
order, and a `SKILLS` resource
     named the same at the environment and agent level keeping the agent's 
value).
   - **Python** — `test_react_agent.py` (the same constructor contracts as the 
Java side),
     `test_react_agent_skills.py` (runtime resolution, merged with the explicit 
skills),
     `test_cross_language_skill_sources.py` (specs crossing the bridge as flat 
`{scheme, params}` maps).
   - **e2e** — `SkillsIntegrationTest` (Java) and `agent_skills_test.py` 
(Python) now name the skill on the
     `ReActAgent` constructor instead of the descriptor
   
   ### API
   
   
   - **`ReActAgent`** — Java: new 4-arg constructors over `List<String>` / 
`Skills`, the 3-arg form unchanged (a
     bare `null` fourth argument is now ambiguous and needs a cast). Python: 
new `skills=None` keyword.
   - **`ResourceContext` / `JavaResourceAdapter` / `SkillManager` / 
`AgentPlan`** — new methods; nothing existing
     breaks.
   - **`Agent.addResourcesIfAbsent`** — environment entries now come first in 
iteration order, and a same-name
     clash keeps the agent's value, matching the Javadoc.
   
   ### Documentation
   
   <!-- Do not remove this section. Check the proper box only. -->
   
   - [ ] `doc-needed` <!-- Your PR changes impact docs -->
   - [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [x] `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
   
   Generated-by: cursor (deepseek-v4.1-flash)
   


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