Repository navigation
feat(tui): add /delete command to remove current session - #182701
Open
thetingster wants to merge 1 commit into
Open
thetingster wants to merge 1 commit into
thetingster wants to merge 1 commit into
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
thetingster
force-pushed
the
feat/tui-delete-command
branch
2 times, most recently
from
October 24, 2026 16:14
b30c7e1 to
51ed561
Compare
thetingster
force-pushed
the
feat/tui-delete-command
branch
from
October 24, 2026 16:28
51ed561 to
11d3224
Compare
Contributor
|
Codex review: stale review; fresh review needed. Summary Next step Review history (1 earlier review cycle)
|
thetingster
force-pushed
the
feat/tui-delete-command
branch
3 times, most recently
from
October 24, 2026 18:03
5dd588f to
39058fa
Compare
Adds a /delete slash command (with /rm alias) to the OpenClaw TUI that permanently deletes the current session and its transcript, then falls back to a fresh session. - Confirmation overlay prevents accidental deletion - Archives transcript to .deleted.<ts>.<hash>.zst before removal - Falls back to agent home session or creates new tui-<uuid> - Works in both gateway-connected and local/embedded modes - Leverages existing sessions.delete RPC (already server-side)
thetingster
force-pushed
the
feat/tui-delete-command
branch
from
October 24, 2026 18:23
39058fa to
ac41a5d
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
The OpenClaw TUI provides
/new(spawn a new session) and/reset(reset current session history), but there is no way for a user to remove a session entirely. Users who want to clean up old sessions must exit the TUI and use external tools or the Gateway API directly.This PR exposes the existing
sessions.deleteRPC (already fully implemented server-side) through the TUI, giving users a first-class way to delete sessions without leaving the terminal interface.Evidence
sessions.create, calledsessions.deletewith exact TUI params, confirmed:deleted: truereturnedsessions.list.deleted.<timestamp>.<hash>.zstnode --checkSummary
Adds a
/deleteslash command (with/rmalias) to the OpenClaw TUI that permanently deletes the current session and its transcript, then falls back to a fresh session.Behavior
/deleteopens a confirmation overlay showing the target session key and warning that the session and transcript will be permanently removed.sessions.deletewith:deleteTranscript: true— archives the transcript to<session>.jsonl.deleted.<ts>.<hash>.zstexpectedSessionId— optimistic-concurrency guard to prevent deleting a session that was recreatedtui-<uuid>session otherwiseabort the current run before /delete)Implementation
Files changed
src/tui/commands.ts/deleteand/rmto command definitionssrc/tui/tui-command-handlers.tsdeleteCurrentSession,confirmDeleteSession,createFallbackSession,clearRememberedSessionPointer; wire into dispatch map; extend session transition typessrc/tui/gateway-chat.tsclient.deleteSession()→sessions.deleteRPC wrappersrc/tui/embedded-backend.tsdeleteSession()for local/embedded mode; addresolveLocalGatewayContext()helpersrc/gateway/local-request-context.tscreateLocalGatewayRequestContext(needed by embedded backend)Key design decisions
/delete→ overlay → select) prevents accidental data loss.sessions.deletealready archives transcripts before removing them. The TUI inherits this behavior without additional work./newbehaves.sessions.deleterequiresoperator.admin. The TUI already requests this scope at connection time, so no auth changes are needed.Compatibility
/rmprovided as shorthand (matches common CLI conventions)--localTUI modesExample
Checklist
Source-level patch: For maintainers who want the exact
src/changes rather than reading the diff, all changes are in the 5 files listed above. The logic maps directly from the compileddist/patches that were tested against[email protected].