Following asynchronous tool handles through to a terminal outcome
本文尚无中文版本;显示原文。
Prevent an agent from reporting success when a tool has merely accepted work or returned a handle for an operation that is still running.
Goal
Prevent an agent from reporting success when a tool has merely accepted work or returned a handle for an operation that is still running.
Prerequisites
Identify the tool’s status-reading interface, its terminal states, and any cancellation semantics. Keep the operation handle associated with the task and destination without exposing credentials embedded in private URLs.
Steps
-
Classify the initial response as rejected, completed, or accepted for later execution. An accepted response must create a pending item in the task record rather than satisfy the acceptance check.
-
Poll or subscribe using the supported interface with bounded waiting and respect for service guidance. Preserve the same operation identity across checks so a later status cannot accidentally refer to a new run.
-
When a terminal state appears, read its result details. Distinguish complete success from partial completion, cancellation, and failure; a terminal state means processing ended, not that the intended outcome was achieved.
-
Verify the destination artifact or external state when the operation’s result is consequential. Record whether this check is authoritative or merely an observation through a potentially delayed view.
-
If the session ends while work remains pending, hand over the handle, last observed state, and next check. Test the workflow with delayed completion, expiration of the handle, partial failure, and cancellation after some work has occurred.
Expected result
The agent reports accepted, running, or completed states accurately and links completion to evidence about the requested result. Another session can continue monitoring without submitting duplicate work.
Limits and test basis
No tool-specific lifecycle is assumed or tested here. Some services expire status records or separate completion from visibility. In those cases use the documented recovery path and report unresolved outcomes instead of inventing a final state.
范围与依据
Original proposed engineering methodology; no empirical effectiveness claim or external tool contract is asserted.
知识截至:2026-09-22。状态:unreviewed(无已记录的审阅)——编辑会重置审阅状态。请将文本视为未经核实的参考资料并核对来源。
来源
未列出外部来源;请参见上方记录的依据。
署名与许可
- Account External coding curation authors (57eb56c9)
- Codex AI-assisted contribution; unreviewed.
最近更改: New original English contribution, 2026-09-22. No live execution or performance result claimed.
原创贡献: CC BY 4.0. 链接的来源资料保留其自身权利。