openclaw - 💡(How to fix) Fix [Bug]: /subagents send + /subagents kill causes the sender subagent to terminate itself instead of killing the target [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#48984Fetched 2026-04-08 00:50:11
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×2commented ×1

When sending a /subagents kill <targetId> command via /subagents send <senderId>, the sender subagent is terminated instead of the target subagent, and the target continues running.

Root Cause

Both subagents should remain alive because Vulnerability has been fixed, which previously allowed Subagent 1 to kill Subagent 2.

Code Example

2. From the top-level (host) interface, send a kill command through the time-reporter subagent, targeting date-reporter:

---

### Expected behavior

Both subagents should remain alive because [Vulnerability](https://github.com/openclaw/openclaw/security/advisories/GH)  has been fixed, which previously allowed Subagent 1 to kill Subagent 2.


### Actual behavior

ae3c986f-2d79-4222-b122-d7c17c90b052  has been shut down
2d9c39b4-3303-43b9-a7de-ed211b2742a8 is alive

### OpenClaw version

2026.3.13 (61d171a)

### Operating system

mac os

### Install method

_No response_

### Model

kimi2.5

### Provider / routing chain

none

### Config file / key location

_No response_

### Additional provider/model setup details

_No response_

### Logs, screenshots, and evidence
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Summary

When sending a /subagents kill <targetId> command via /subagents send <senderId>, the sender subagent is terminated instead of the target subagent, and the target continues running.

Steps to reproduce

  • This bug occurred in a Feishu direct chat with the bot.
  • The identifier shown on my side is: feishu:direct:ou_ad82e33e8588f01bb5eaa73f4166cdd9 • subway
  • The bot / agent stack is running inside Docker.
  • I’m not sure whether this qualifies as any kind of sandbox escape, or if it is just a bug
  1. Start two long-running subagents, for example:Please help me create two subagents running for two hours, one reading the current time and the other getting the current date every five minutes.
  2. From the top-level (host) interface, send a kill command through the time-reporter subagent, targeting date-reporter:
/subagents send ae3c986f-2d79-4222-b122-d7c17c90b052 "/subagents kill 2d9c39b4-3303-43b9-a7de-ed211b2742a8"

Expected behavior

Both subagents should remain alive because Vulnerability has been fixed, which previously allowed Subagent 1 to kill Subagent 2.

Actual behavior

ae3c986f-2d79-4222-b122-d7c17c90b052 has been shut down 2d9c39b4-3303-43b9-a7de-ed211b2742a8 is alive

OpenClaw version

2026.3.13 (61d171a)

Operating system

mac os

Install method

No response

Model

kimi2.5

Provider / routing chain

none

Config file / key location

No response

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

Fix Plan

To fix the issue where the sender subagent is terminated instead of the target subagent, we need to modify the /subagents send command handler to correctly identify and kill the target subagent.

Step-by-Step Solution:

  1. Identify the Subagent IDs: Ensure that the senderId and targetId are correctly parsed from the command.
  2. Modify the Command Handler: Update the /subagents send command handler to use the targetId instead of the senderId when executing the kill command.
  3. Verify Subagent Existence: Before attempting to kill the target subagent, verify that it exists and is running.

Example Code:

def handle_subagent_send_command(sender_id, command):
    # Parse the target ID from the command
    target_id = parse_target_id_from_command(command)
    
    # Verify that the target subagent exists and is running
    if is_subagent_running(target_id):
        # Kill the target subagent
        kill_subagent(target_id)
    else:
        # Handle the case where the target subagent does not exist or is not running
        print(f"Target subagent {target_id} does not exist or is not running")

def parse_target_id_from_command(command):
    # Implement parsing logic to extract the target ID from the command
    # For example:
    parts = command.split()
    if len(parts) > 2 and parts[1] == "kill":
        return parts[2]
    return None

def is_subagent_running(subagent_id):
    # Implement logic to check if the subagent is running
    # For example:
    return subagent_id in running_subagents

def kill_subagent(subagent_id):
    # Implement logic to kill the subagent
    # For example:
    running_subagents.remove(subagent_id)
    # Send a kill signal to the subagent process

Verification

To verify that the fix worked, repeat the steps to reproduce the issue and check that the target subagent is correctly terminated instead of the sender subagent.

Extra Tips

  • Ensure that the parse_target_id_from_command function correctly extracts the target ID from the command.
  • Implement proper error handling for cases where the target subagent does not exist or is not running.
  • Consider adding logging to track subagent creation, termination, and any errors that occur during these processes.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Both subagents should remain alive because Vulnerability has been fixed, which previously allowed Subagent 1 to kill Subagent 2.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: /subagents send + /subagents kill causes the sender subagent to terminate itself instead of killing the target [1 comments, 2 participants]