wenjin272 opened a new issue, #1368:
URL: https://github.com/apache/flink-agents/issues/1368

   ### Search before asking
   
   - [x] I searched the issues and found nothing similar.
   
   ### Description
   
   A Java internal subagent cannot use a model router inherited from its 
parent. `ModelRoutingResolver` asks `RunnerContext.hasResource(name, 
MODEL_ROUTER)`, but `RunnerContextImpl` currently checks only the child cache. 
It consequently treats the router name as a concrete chat model and fails to 
resolve it.
   
   Presence checks and resource retrieval should use the same scope rules: 
search the nearest scope first, and inherit from ancestors only when the child 
has no same-name chat model or router. Chat models and routers share a name 
namespace, so a local declaration of either must hide both types in ancestors. 
Simply switching the presence check to the existing recursive helper would let 
a parent router override a child's same-name chat model.
   
   ### How to reproduce
   
   1. Register a chat model `small` and a router `router` selecting `small` on 
a parent agent.
   2. Register an internal child agent with neither resource locally declared.
   3. In the child action, call `ctx.chat("router", messages).await()`.
   4. The request fails while looking for `router` as `CHAT_MODEL`, instead of 
using the inherited router.
   
   Also cover local model/router overrides, nested scopes, provider failures, 
and parent ownership of inherited resources.
   
   Related: #1062. This is a standalone Java runtime fix; Python routing 
support is tracked separately in #1362.
   
   ### Version and environment
   
   Current main at d698f2d6da559bcca7400bde6d6df537ae513351 (1.0-SNAPSHOT), 
Java internal subagents. Regression tests use JDK 21 and the Flink operator 
harness with mock models.
   
   ### Are you willing to submit a PR?
   
   - [x] I'm willing to submit a PR!
   


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