eemario commented on code in PR #1405:
URL: https://github.com/apache/flink-agents/pull/1405#discussion_r4610923431
##########
plan/src/main/java/org/apache/flink/agents/plan/actions/ChatModelInvoker.java:
##########
@@ -110,6 +132,57 @@ public static String errorText(Exception error) {
: error.getClass().getName() + ": " +
String.valueOf(error.getMessage());
}
+ /**
+ * A client error is not retried. 408, 409, 429, and 5xx are. Anything
without an HTTP status,
+ * including a timeout, keeps the previous retry behavior. Status is read
from the failure or a
+ * cause, so a {@code RuntimeException} wrapper does not hide it.
+ */
+ static boolean isRetryableProviderFailure(Throwable error) {
Review Comment:
When a Java action calls a Python chat model through `PythonChatModelSetup`,
the provider exception crosses Pemja before reaching this classifier. A Python
exception carrying `status_code=400` becomes a `pemja.core.PythonException`
without a status accessor or cause, so this method returns `true` and the
rejected request still consumes the retry budget.
I reproduced this using the project's Pemja dependency and this PR's
classifier: `status_code=400` → `PythonException`, `cause=null` →
`retryable=true`.
Could we ensure that client errors remain non-retryable across this boundary
and add a regression test for the cross-language retry path?
--
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]