wenjin272 commented on PR #677:
URL: https://github.com/apache/flink-agents/pull/677#issuecomment-4456486140

   ### Code review
   
   Found 1 issue:
   
   1. `ToolResponseEvent` passes `Map.of()` — an immutable JDK map — directly 
to `setAttr("external_ids", ...)`, which is the same Kryo 
`InaccessibleObjectException` root cause this PR is fixing for lists, but was 
not addressed here.
   
   
https://github.com/apache/flink-agents/blob/08bb5452dfddc7dd74c1fc782b3927621e0b5482/api/src/main/java/org/apache/flink/agents/api/event/ToolResponseEvent.java#L52-L58
   
   The 4-arg convenience constructor delegates to the 5-arg constructor with 
`Map.of()` as the `externalIds` argument (line 57), which is then stored 
unchanged via `setAttr("external_ids", externalIds)` (line 48). `Map.of()` 
returns a sealed internal JDK class (`ImmutableCollections$Map0` / `MapN`) that 
Kryo cannot reflectively access on JDK 17+, identical to the `List.of(...)` 
case. The fix is the same: pass `new HashMap<>()` instead of `Map.of()`.
   
   🤖 Generated with [Claude Code](https://claude.ai/code)
   
   <sub>- If this code review was useful, please react with 👍. Otherwise, react 
with 👎.</sub>


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