]> git.giacomolli.uk - onechat/commit
Stop a subagent with /stop NAME
authorAnderson A. Giacomolli <agiacomolli@gmail.com>
Sun, 8 Nov 2026 13:53:29 +0000 (10:53 -0300)
committerAnderson A. Giacomolli <agiacomolli@gmail.com>
Sun, 8 Nov 2026 13:53:29 +0000 (10:53 -0300)
commit47f69638bc96100f2e446f63c7c3689023156e64
tree8b4fc6579561e91bad0cf8c5410ba860e3843480
parente1e48ba388c28105fff3b70c8ca02304f5d57f53
Stop a subagent with /stop NAME

The line "/stop NAME" in the terminal client and in Telegram stops the
running subagent NAME: its model call ends, and a running command is
killed with its process group. The chat gets the note "Stopped by the
user: NAME.", and then the report of the subagent with the reply
"stopped", which is logged but starts no turn, so the agent does not act
on a subagent that the user stopped. A name that does not run gives an
answer to the client. The bare "/stop" still interrupts only the turn of
the agent.

The note is logged under the mutex of the runs, which the run takes
before its report, so the note always comes before the report.

Issue: b1ac698
12 files changed:
README.rst
daemon.go
daemon_test.go
socket.go
stop.go
stop_test.go [new file with mode: 0644]
subagent_run.go
subagent_run_test.go
telegram.go
telegram_test.go
terminal.go
turn.go