tools.await_task module

Synchronously block until a background task completes.

Unlike check_task which returns immediately with a status snapshot, await_task suspends the entire inference cycle until the task finishes. From the LLM’s perspective no time passes — the result materialises in the very next thought block.

async tools.await_task.run(task_id=None, timeout=300.0, ctx=None, **_kwargs)[source]

Execute this tool and return the result.

Parameters:
  • task_id (str | None) – Background task identifier.

  • timeout (float) – Maximum wait time in seconds.

  • ctx (ToolContext | None) – Tool execution context providing access to bot internals.

Returns:

Result string.

Return type:

str