You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "CodeTrainerMan (via GitHub)" <gi...@apache.org> on 2026/09/24 20:12:37 UTC
[I] [Bug][api] ContextRetrievalRequestEvent accepts a non-positive max_results [flink-agents]
CodeTrainerMan opened a new issue, #1156:
URL: https://github.com/apache/flink-agents/issues/1156
### Description
`ContextRetrievalRequestEvent` does not validate `max_results`:
* Java: `api/src/main/java/org/apache/flink/agents/api/event/ContextRetrievalRequestEvent.java` (3-arg constructor, L40-45)
* Python: `python/flink_agents/api/events/context_retrieval_event.py` (`__init__`, L45-54)
Both constructors accept `0` and negative values and store them as-is.
### Impact
`max_results` is passed straight into `VectorStoreQuery` by `ContextRetrievalAction`:
* `plan/src/main/java/org/apache/flink/agents/plan/actions/ContextRetrievalAction.java` (L71-74)
* the Python counterpart in `python/flink_agents/plan/actions/context_retrieval_action.py`
Since #1144 made `VectorStoreQuery` reject a non-positive `limit`, an illegal `max_results`
now fails **inside the action at runtime**, far away from where the user actually built the
event. The event is also serialized and exchanged between the Java and Python runtimes, so
an invalid value can cross the language boundary before it blows up.
Validating at construction time fails fast and reports the parameter that is actually wrong.
### Proposed change
Reject `max_results <= 0` in both constructors:
* Java: `IllegalArgumentException`, naming the parameter and its value, consistent with #1144
* Python: `ValueError` (this event is a plain class, not a pydantic model)
Add unit tests on both sides.
### Related
* #1144 - Reject null and non-positive limit in VectorStoreQuery
--
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: issues-unsubscribe@flink.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Tech Debt][api] ContextRetrievalRequestEvent accepts a non-positive max_results [flink-agents]
Posted by "wenjin272 (via GitHub)" <gi...@apache.org>.
wenjin272 closed issue #1156: [Tech Debt][api] ContextRetrievalRequestEvent accepts a non-positive max_results
URL: https://github.com/apache/flink-agents/issues/1156
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org