Skip to content
DevLaunch home

Guide · Agent orchestration

Astra Async Tools: Keep Working While a Lookup Runs

Use GPT-6 Astra async tool calling for independent work while keeping pending results, dependencies, and final answers consistent.

By DevLaunchPublished

A slow lookup does not have to stop every part of a task. While a reporting assistant fetches a large export, it may be able to prepare the report structure or inspect an already available document. The key is to keep independent work moving without pretending the missing result has arrived.

Know what the API does

OpenAI documents async function and custom tools for GPT-6 Astra. Your application marks an eligible tool as async, executes the job, and returns its result using the original call ID. The model can continue independent work while that job runs. The application remains responsible for the pending job.

For a hypothetical weekly report, the export request is one job. Drafting section headings can proceed while it runs. Calculating the final totals cannot. Write down that dependency so a quick draft does not become an unsupported final answer.

Register the job before relying on it

Keep a record of the tool call, task identifier, start time, status, and result location. Make the association before a later step tries to wait for or retrieve the result. Use distinct identifiers for repeated requests, including a second export for the same customer.

A record of the inputs is useful too. If the user changes the date range while the first export is running, you need to know which range the returning file covers. The same filename or customer name is not enough to identify the correct result.

Make waiting a deliberate step

OpenAI's guide describes an application-defined wait tool. It is a pattern you implement, not a built-in Responses tool. It can let the model wait for specific unfinished jobs when the next action depends on them.

In the reporting example, wait before producing the final totals. If the export fails, return a failure that the coordinator can act on. Do not turn an empty result into a report with zero activity. The difference between "no records" and "could not retrieve records" needs to survive the handoff.

Handle a late result after the plan changes

Suppose the user narrows the report to a different period. Mark the original job as no longer relevant to the current report, even if you cannot cancel the underlying service request. When it finishes, retain its provenance and prevent it from replacing the current result.

Apply the same rule when a workflow is stopped. Canceling the model conversation does not necessarily cancel an external job already running. Your application needs to handle completion events after the user-facing task has ended.

Check the combination you are using

The current OpenAI guide says async tools do not apply to hosted built-in tools, and warns against combining async tools with parallel tool calls in multi-agent mode. Check those compatibility details before copying an example into a larger agent setup.

Test a successful lookup, a failure, an out-of-order completion, and a changed request. Those cases reveal whether your application can keep useful work moving while still delivering the right final result.

Sources & further reading

Keep building

View topic →