dowhiledev / dowhiledev/nomos

Async / Long-Running Tool Calls

Open
#131 1 comment 0 reactions 0 assignees View on GitHub
New Feature
Dominant language
Python
Stars
88
Forks
12
PR merge metrics
No merged PRs in 30d

Description

## Goal
Enable an agent to launch slow-running tool calls, remain responsive (continue conversation or perform other tasks), and automatically deliver results as soon as they are ready—without waiting for another user message.

## User Story
As an end user,
I want the agent to start time-consuming operations (large queries, heavy ML jobs, etc.) without freezing the conversation,
so that I can keep chatting or receive interim updates, and the agent can push the final result the moment it completes - even if I have not sent a new query.

## Acceptance Criteria

ID | Description
-- | --
AC-1 | A step can tag any tool call with async: true and an optional timeout.
AC-2 | When an async call is triggered, it is placed in a queue with metadata {step_id, tool_name, params, timeout, started_at}.
AC-3 | While queued calls run, the agent can: (a) not transition to other steps, (b) send user-facing progress messages, (c) handle new user input normally, and (d) run non dependant tool calls.
AC-4 | If a queued call finishes within timeout, the result is injected into the originating step’s context and the agent immediately produces the next decision (no user prompt required).
AC-5 | If timeout expires, the agent must ask the user whether to extend the wait or skip the tool.
AC-6 | Declining to wait removes that tool from the step’s tool list and unlocks normal step transitions.
AC-7 | All queued calls are isolated per step; results cannot leak across steps unless explicitly shared.

```mermaid
sequenceDiagram
participant U as User
participant A as Agent
participant Q as Async-Queue
participant T as Tool (slow)

U->>A: Ask question requiring heavy job
A->>Q: enqueue(tool_call, timeout)
Q->>T: execute tool async
A-->>U: Processing… you can keep chatting

alt user keeps chatting
U->>A: New question
A-->>U: Answers immediately
end

T-->>Q: Result ready
Q->>A: deliver(tool_result)
A-->>U: Push final answer (no new prompt)

alt timeout expires
Q->>A: Timeout notification
A-->>U: Still running—wait longer?
U->>A: Yes, extend / No, skip
A->>Q: extend or cancel
end

```

## Summary
This asynchronous pattern lets the agent behave more like a real assistant: it can start long-running tasks, remain interactive, and proactively deliver results as soon as they are available, improving both user experience and agent productivity.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.