@@ -268,25 +268,12 @@ public HTTPRestResponse listTasks(@Nullable String contextId, @Nullable String s
268268 paramsBuilder .tenant (tenant );
269269 if (statusTimestampAfter != null ) {
270270 try {
271- // Try parsing as Unix milliseconds first (integer)
272- long millis = Long .parseLong (statusTimestampAfter );
273- if (millis < 0L ) {
274- Map <String , Object > errorData = new HashMap <>();
275- errorData .put ("parameter" , "statusTimestampAfter" );
276- errorData .put ("reason" , "Must be a non-negative timestamp value, got: " + millis );
277- throw new InvalidParamsError (null , "Invalid params" , errorData );
278- }
279- paramsBuilder .statusTimestampAfter (Instant .ofEpochMilli (millis ));
280- } catch (NumberFormatException nfe ) {
281- // Fall back to ISO-8601 format
282- try {
283- paramsBuilder .statusTimestampAfter (Instant .parse (statusTimestampAfter ));
284- } catch (DateTimeParseException e ) {
285- Map <String , Object > errorData = new HashMap <>();
286- errorData .put ("parameter" , "lastUpdatedAfter" );
287- errorData .put ("reason" , "Must be valid Unix milliseconds or ISO-8601 timestamp" );
288- throw new InvalidParamsError (null , "Invalid params" , errorData );
289- }
271+ paramsBuilder .statusTimestampAfter (Instant .parse (statusTimestampAfter ));
272+ } catch (DateTimeParseException e ) {
273+ Map <String , Object > errorData = new HashMap <>();
274+ errorData .put ("parameter" , "statusTimestampAfter" );
275+ errorData .put ("reason" , "Must be an ISO-8601 timestamp" );
276+ throw new InvalidParamsError (null , "Invalid params" , errorData );
290277 }
291278 }
292279 if (includeArtifacts != null ) {
0 commit comments