eemario opened a new pull request, #1423:
URL: https://github.com/apache/flink-agents/pull/1423

   Linked issue: #1411
   
   ### Purpose of change
   
   Configure asynchronous external-subagent polling with 
`status_poll_interval`, using Java `Duration` or Python `timedelta`. The 
default stays at 500 ms.
   
   #### Runtime flow
   Java reads the resource descriptor through `getDurationArgument`; Python 
validates its field with `parse_duration`. Both reuse the existing shared 
duration parsers. The polling loop converts the duration at the sleep call: 
milliseconds plus nanoseconds in Java, seconds in Python.
   
   #### Key decisions
   Remove the unit suffix from the configuration key and preserve 
whole-microsecond input precision. Descriptor durations serialize as ISO 
strings. The shared ResourceDescriptor changes are identical to #1410 and can 
be rebased away once either PR merges. Submission, reconciliation, and 
result-fetching behavior remain unchanged.
   
   ### Behavioral Semantics
   
   #### Input behavior
   | Input | Result |
   | --- | --- |
   | Omitted | 500 ms |
   | Duration/timedelta, unit string, ISO string | Parsed at whole-microsecond 
precision |
   | Bare integer / integer string | Milliseconds |
   | Zero | No configured polling delay |
   | Negative, malformed, or sub-microsecond value | Construction fails |
   
   Java explicit null retains the descriptor default; Python explicit None 
remains invalid. These existing language-specific null semantics are unchanged.
   
   #### Contracts and failures
   The configured duration reaches the polling wait without explicit truncation 
to whole milliseconds; actual scheduling depends on the OS. Parsing and sign 
failures identify `status_poll_interval`. Sleep interruption/errors and remote 
probe/fetch failures continue to propagate through the durable wait.
   
   ### Tests
   
   | Contract | Coverage |
   | --- | --- |
   | Descriptor parsing and JSON preservation | ResourceDescriptorTest |
   | Java defaults, numeric and duration inputs, round-trip, invalid input | 
BaseAsyncSubagentSetupTest |
   | Python defaults, numeric and duration inputs, JSON, invalid input | 
test_async_subagent.py |
   | Existing submit/await/recovery behavior | Existing Java and Python 
async-subagent tests |
   
   29 Java and 33 Python tests passed. Spotless, Ruff, and git diff --check 
passed. Exact wall-clock sleep timing, extreme-duration sleeps, remote subagent 
services, and the Pemja cross-language suite were not tested.
   
   <details>
   <summary>Verification commands</summary>
   
   ```bash
   mvn --batch-mode --no-transfer-progress test -pl runtime -am 
-Dtest=ResourceDescriptorTest,BaseAsyncSubagentSetupTest,ExternalAsyncSubagentSetupTest
 -Dsurefire.failIfNoSpecifiedTests=false
   python -m pytest flink_agents/runtime/tests/test_async_subagent.py -q
   ```
   
   </details>
   
   ### API
   
   Rename `status_poll_interval_millis` to `status_poll_interval`. Java 
subclasses use `Duration statusPollInterval` and `FIELD_STATUS_POLL_INTERVAL`; 
Python uses the timedelta field. Bare integer values still mean milliseconds. 
Adds the shared public `ResourceDescriptor.getDurationArgument` accessor. 
Existing declarations must update the key and subclass field references; no 
deprecated alias is retained.
   
   ### Documentation
   
   - [ ] doc-needed
   - [ ] doc-not-needed
   - [x] doc-included
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   - [x] Yes
   - [ ] No
   
   Generated-by: Codex CLI 0.167.0-alpha.4.1 (GPT-6)
   


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