You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fe0677c
Browse filesBrowse the repository at this point in the historyBrowse files
feat(agent): run process starts once per tool call
chatd needs to start at most one process per tool call and to stop that
process on a user interrupt, across task retries and ownership changes.
The start route now runs through the tool call store's middleware. With
a tool call in the request context, the process ID is the tool call
UUID, so chatd can address the process without the start response. The
start registers a cancel hook that kills the process (the process group
on Unix) and marks it canceled only when the kill succeeded; its channel
closes when the process exits. A start whose body cannot be decoded
abandons its run, so a retried request runs.
timeout_ms stores the execute deadline at the first start. A replay
returns the recorded response, so it never moves the deadline. The
output wait ends at exit, at the deadline, or at the 5-minute cap, and
the answer reports timed_out, canceled, and duration_ms.
An exited process started by a tool call is reaped once the store no
longer retains its record; other processes keep the 5-minute rule. A
one-minute ticker on the agent clock sweeps the store and reaps, so
reaping no longer depends on process_list. Close stops it.
The agent holds one store per instance and mounts the cancel route at
POST /api/v0/tool-calls/{id}/cancel.
0 commit comments