Skip to content

[Bug]: chat.abort cannot stop active agent runs; only works for chat.send runs #71128

Closed

Description

@xiaomomo

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Summary

chat.abort currently cannot stop active runs started via the public
agent RPC.
It only aborts runs tracked in chatAbortControllers, which are created by
chat.send.

This makes it impossible for external runtimes that integrate through
agent to implement a proper "Pause/Stop current session" using public
Gateway RPCs.

Relevant implementation details

  • chat.abort checks context.chatAbortControllers
  • chat.send registers runs into chatAbortControllers
  • agent does not register its runs into chatAbortControllers
  • /stop full semantics live in command handling, not in chat.abort

Why this matters

External apps may intentionally use agent instead of chat.send because
they need:

  • raw agent lifecycle/tool/approval events
  • per-run system prompt injection
  • host-managed conversation/run state

Right now those apps cannot implement a proper public "stop current run/
session" without depending on OpenClaw internal modules.

Suggested direction

Preferred:

  • expose a stable public sessions.stop RPC equivalent to /stop

Alternative:

  • extend public abort APIs so they can stop active agent session runs as
    well

Steps to reproduce

  1. Start a long-running session via the public agent RPC:
    • method: agent
    • params: { sessionKey, message, idempotencyKey, ... }
  2. While the run is still streaming, call:
    • chat.abort({ sessionKey, runId })
    • or chat.abort({ sessionKey })
  3. Gateway returns:
    • { ok: true, aborted: false, runIds: [] }
  4. The run continues.

Expected behavior

One of the following should be true:

  1. chat.abort / sessions.abort should also be able to interrupt active
    session runs started by agent, or
  2. OpenClaw should expose a public session-level stop API, e.g.
    sessions.stop, with semantics equivalent to /stop:
    • clear queued followups / lane queue
    • stop active embedded run
    • stop descendant subagents
    • trigger stop command hooks

Actual behavior

chat.abort only checks chatAbortControllers, which are populated by
chat.send.
agent runs are not registered there, so abort returns aborted:false even
when the run is still active.

OpenClaw version

2026.4.9

Operating system

macOS 15.4

Install method

npm global

Model

minimax

Provider / routing chain

openclaw -> minimax

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Activity

  1. added
    bug
    on Apr 24, 2026
  2. added
    bug:behavior
    on Apr 24, 2026
  3. edvisage commented on Apr 24, 2026

    @edvisage

    This is worth prioritizing beyond a standard bug fix. An abort mechanism that only works on chat.send runs but not active agent runs means humans cannot reliably interrupt autonomous agent behavior once it starts. That's a human oversight gap — the assumption that you can stop an agent at any point is foundational to safe deployment. Any agent running with tool access, file permissions, or external API calls that cannot be reliably aborted mid-run is an uncontrolled process. The fix needs to guarantee interruption at the execution boundary, not just at the communication layer, otherwise abort becomes a false sense of control rather than an actual safety mechanism.

  4. added a commit that references this issue on Apr 24, 2026
    8cae2ed
  5. added a commit that references this issue on Apr 25, 2026
    2d276cc
  6. locked as resolved and limited conversation to collaborators on Apr 27, 2026
  7. added a commit that references this issue on May 2, 2026
    3890f10
  8. added a commit that references this issue on May 13, 2026
    2fdaa15
  9. added a commit that references this issue on May 24, 2026
    f2e31f5
  10. added a commit that references this issue on Jun 2, 2026
    739a2a5
  11. added a commit that references this issue on Jun 10, 2026
    729e96b
  12. added a commit that references this issue on Aug 16, 2026
    241e4f2
  13. added a commit that references this issue on Sep 28, 2026
    2b45eaa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugbug:behavior

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions