[GH-ISSUE #253] feat: visibility and control over background subagents (list, open, cancel) #168

Open
opened 2026-10-18 14:03:31 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @1-kabir on GitHub (Sep 5, 2026).
Original GitHub issue: https://github.com/open-webui/computer/issues/253

feat: visibility and control over background subagents (list, open, cancel)

Feature description

When the agent dispatches background subagents (via delegate_task), there is
no way to see them, open the underlying chat, or cancel a runaway one. They
run invisibly in the background.

Proposed solution

  • Backend:
    • GET /api/chats/{id}/subagents and POST /api/chats/{id}/subagents/{delegation_id}/cancel (ownership-checked like the rest of the chat router).
    • Registry helpers to track cancel_async_subagent and a parent_chat_id filter, plus a socket push (e.g. chat:subagents) on state changes.
    • Foreground delegate_task returning the same JSON shape as background dispatches (delegation_id + subagent_chat_id) so every delegation is clickable.
  • Frontend:
    • A "Subagents" bar above the chat input (tasks-card style) listing running/finished background subagents with Open (opens the subagent chat in a tab) and Kill (confirm, then cancel API) actions.
    • Live updates via the existing events:chat socket channel, same pattern as chat:tasks.
    • Expanded delegate_task tool calls that carry a subagent chat id get an Open button; the background completion row gets an "Open sub-agent chat" action.

Additional context

Implemented on a fork; can share implementation notes.


Originally created by @1-kabir on GitHub (Sep 5, 2026). Original GitHub issue: https://github.com/open-webui/computer/issues/253 feat: visibility and control over background subagents (list, open, cancel) ### Feature description When the agent dispatches background subagents (via `delegate_task`), there is no way to see them, open the underlying chat, or cancel a runaway one. They run invisibly in the background. ### Proposed solution - Backend: - `GET /api/chats/{id}/subagents` and `POST /api/chats/{id}/subagents/{delegation_id}/cancel` (ownership-checked like the rest of the chat router). - Registry helpers to track `cancel_async_subagent` and a `parent_chat_id` filter, plus a socket push (e.g. `chat:subagents`) on state changes. - Foreground `delegate_task` returning the same JSON shape as background dispatches (`delegation_id` + `subagent_chat_id`) so every delegation is clickable. - Frontend: - A "Subagents" bar above the chat input (tasks-card style) listing running/finished background subagents with **Open** (opens the subagent chat in a tab) and **Kill** (confirm, then cancel API) actions. - Live updates via the existing `events:chat` socket channel, same pattern as `chat:tasks`. - Expanded `delegate_task` tool calls that carry a subagent chat id get an **Open** button; the background completion row gets an "Open sub-agent chat" action. ### Additional context Implemented on a fork; can share implementation notes. ---
Author
Owner

@owui-terminator[bot] commented on GitHub (Sep 5, 2026):

🔍 Related Issues Found

I found some existing issues that might be related. Please check if any of these are duplicates or contain helpful solutions:

  1. 🟢 #220 bug: Chat ends when Claude Code agent spawns a background agent and never resumes
    This reports the same core problem that background subagents are spawned invisibly and the parent chat flow cannot properly track or resume them. It overlaps with the new issue’s goal of exposing background subagents and making them actionable from the UI.
    by JKGeovision

  2. 🟣 #195 bug: the claude CLI subprocess is torn down at the end of every turn, killing in-flight background agents
    This closed issue is directly about in-flight background agents being killed, which is closely related to the new request for cancel/control over background subagents. It provides important context on lifecycle handling for delegated background work.
    by penradioGables

  3. 🟢 #213 bug: a stalled agent session hangs the chat task forever, and the whole transcript is lost if you kill it
    This discusses agent runs getting stuck and lacking a way to stop them cleanly, which aligns with the new issue’s need for cancel controls over runaway subagents. The persistence/data-loss aspect is broader, but the lack of cancellation is relevant.
    by ThalynLabs


💡 If your issue is a duplicate, please close it and add any additional details to the existing issue instead.

This comment was generated automatically. React with 👍 if helpful, 👎 if not.

<!-- gh-comment-id:5550970956 --> @owui-terminator[bot] commented on GitHub (Sep 5, 2026): <!-- terminator-bot:related-issues-reply --> 🔍 **Related Issues Found** I found some existing issues that might be related. Please check if any of these are duplicates or contain helpful solutions: 1. 🟢 [#220](https://github.com/open-webui/computer/issues/220) **bug: Chat ends when Claude Code agent spawns a background agent and never resumes** *This reports the same core problem that background subagents are spawned invisibly and the parent chat flow cannot properly track or resume them. It overlaps with the new issue’s goal of exposing background subagents and making them actionable from the UI.* *by JKGeovision* 2. 🟣 [#195](https://github.com/open-webui/computer/issues/195) **bug: the `claude` CLI subprocess is torn down at the end of every turn, killing in-flight background agents** *This closed issue is directly about in-flight background agents being killed, which is closely related to the new request for cancel/control over background subagents. It provides important context on lifecycle handling for delegated background work.* *by penradioGables* 3. 🟢 [#213](https://github.com/open-webui/computer/issues/213) **bug: a stalled agent session hangs the chat task forever, and the whole transcript is lost if you kill it** *This discusses agent runs getting stuck and lacking a way to stop them cleanly, which aligns with the new issue’s need for cancel controls over runaway subagents. The persistence/data-loss aspect is broader, but the lack of cancellation is relevant.* *by ThalynLabs* --- 💡 If your issue is a duplicate, please close it and add any additional details to the existing issue instead. *This comment was generated automatically.* React with 👍 if helpful, 👎 if not.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/computer#168
No description provided.