#session.delete

1 messages · Page 1 of 1 (latest)

lone jewel
#

Is possible to trigger gateway api with a session.delete command to purge a specific sub agent spawned session that I don't need anymore? There is a way to do this via GUI webchat?

native haloBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

open fogBOT
chilly iceBOT
#

Yep, with one important detail: the method is sessions.delete (plural), not session.delete.

  • Gateway API: yes, via the Gateway WS/RPC protocol
    {
      "method": "sessions.delete",
      "params": {
        "key": "agent:main:subagent:...",
        "deleteTranscript": true
      }
    }
    
  • What it does: removes the session entry and archives the transcript as *.deleted.<timestamp>. So it is not a hard shred/purge.
  • Limit: it will not delete the main session.

For the GUI:

#
  • Control UI: yes. There’s a Sessions view where you can select session(s) and hit Delete.
  • Regular webchat UI: no. Webchat clients are blocked from patch/delete session mutations, but Control UI is allowed.

Since you mentioned spawned sub-agents, you may also want to avoid manual cleanup entirely:

  • sessions_spawn(..., cleanup: "delete") to archive/delete right after announce
  • or tune agents.defaults.subagents.archiveAfterMinutes

Docs:

If you want, paste openclaw --version and I can tell you whether your build should already have the Control UI delete flow.

lone jewel
#

Can't find delete button in control UI sessions page

chilly iceBOT
#

Yeah, it’s a bit hidden right now.

In Control UI → Sessions, the Delete button only appears after you select at least one session:

  1. go to Sessions
  2. use the checkbox in the far-left column for a session row
  3. a bulk action bar appears above the table
  4. then you’ll see Delete

So there is no always-visible per-row delete button at the moment, only the bulk action.

If you don’t see the checkbox column at all, please paste:

openclaw --version
#

because that likely means you’re on an older build and the UI action may not be there yet.

Docs: https://docs.openclaw.ai/web/control-ui

If you want, I can also give you the exact sessions.delete WS payload to use as a fallback.

lone jewel
#

Got it thx

chilly iceBOT
#

Glad that helped! 🎉

If this fixed it, please right-click the solution message → Apps → ✅ Mark Solution.

That helps Answer Overflow index it for the next person.