In this article
Treat waiting, terminal state and successful result retrieval as separate observations, especially when an agent gathers evidence from concurrent tasks.
Keep the task handle separate from its answer
A research flow submits several source checks and receives future objects. Those objects identify ongoing executions; they are not the extracted documents. The task reference shows submission and deferred execution returning futures, followed by waiting or result retrieval. A report assembler should consume the resulting evidence, rather than stringify a handle and mistake its presence for a completed source check.
Understand a bounded wait’s return
The future implementation allows wait to stop waiting after its timeout without returning the task’s output. The concurrent future’s wait path returns when its wait expires. This is a limit on observation time; that return does not independently establish that the underlying task completed or stopped. A caller that needs a completed artifact must inspect the execution state or retrieve the result under the appropriate policy.
Retrieve output with explicit failure behavior
The futures reference separates waiting and result methods. Result retrieval can raise for failure, and its timeout behavior differs from a quiet bounded wait. Decide whether a source-check failure should abort assembly or be recorded as an unavailable source. Suppressing an exception deliberately changes what the caller receives; it does not turn the original failed execution into a successful observation of the document.
Interpret collection completion carefully
The collection-level wait returns sets named done and not_done. A completed or cancelled execution can be in the completed set; membership does not mean a useful document was obtained. These are sets, so keep an explicit mapping between future identity and source identity when presentation order matters. Pair each completed execution with its state and usable result before describing coverage across the requested source list.
Preserve unfinished work in the report contract
If the wait budget expires, label outstanding checks as unfinished rather than silently omitting them or declaring them empty matches. Task budgets clarify how long the collector may wait; tool observations capture what it actually learned. The distinction lets a reader understand whether a missing source was rejected, failed, cancelled or simply still running when the report’s evidence window closed.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.