Conversation
The TUI's /quit handler ignored its argument entirely — the --delete flag added for the CLI in NousResearch#27101 never reached any deletion logic. Add a session.exit gateway RPC that mirrors the CLI shutdown path (cli.py:17317): deletes the session's SQLite rows and on-disk transcripts. Unlike session.delete (resume picker), it bypasses the active-session guard because the caller is about to terminate. The frontend now parses --delete / -d, rejects unknown flags with a usage hint, and calls session.exit before ctx.session.die(). Deletion is best-effort (.finally) — the TUI exits regardless, matching the CLI's try/except behavior.
Contributor
Author
|
Apologies for the duplicate — I missed #61353 when searching. Their approach is strictly better: extending the existing |
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 does this PR do?
The TUI's
/quitcommand silently ignores the--deleteflag that the CLI has supported since #27101. In the classic CLI,/exit --deleteparses the flag, arms_delete_session_on_exit, and the shutdown path callsSessionDB.delete_session(). In the TUI, the Ink frontend handler (core.ts) receives the argument as_arg(underscore-prefixed = intentionally unused) and callsctx.session.die()unconditionally — the flag never reaches any deletion logic.This PR ports the CLI's
/exit --deletebehavior to the TUI:New gateway RPC
session.exit(tui_gateway/methods_session.py) — deletes the session's SQLite rows and on-disk transcripts, mirroring the CLI shutdown path (cli.py:17317). Unlikesession.delete(used by the resume picker), it intentionally bypasses the active-session guard because the caller is about to terminate the process.Frontend
--deleteparsing (ui-tui/src/app/slash/commands/core.ts) — the/quithandler now reads its argument, accepts--delete/-d, rejects unknown flags with a usage hint, and callssession.exitbeforectx.session.die(). Best-effort:.finally()ensures the TUI exits regardless of the RPC outcome, matching the CLI'stry/exceptarounddelete_session.Docs — updates
slash-commands.mdto reflect that/quit --deleteworks in both surfaces, and removes/quitfrom the CLI-only list (it was already handled by the TUI frontend; the listing was inaccurate).Related Issue
Ports #27101 (
feat(cli): add /exit --delete flag) to the TUI surface. Related: #56280 (in-TUI session management).Type of Change
Changes Made
tui_gateway/methods_session.py(+36): newsession.exitRPC methodui-tui/src/app/slash/commands/core.ts(+20, −2): parse--delete/-din/quithandler, callsession.exitbefore exittests/test_tui_gateway_server.py(+141): 7 tests forsession.exit(mirrors the existingsession.deletetest structure)website/docs/reference/slash-commands.md(+3, −3):/quitdescription, destructive commands table, CLI-only notesHow to Test
hermes/quit --deletehermes sessions listshould not show it, and~/.hermes/sessions/<id>*files should be deleted/quitstill preserves the session/quit --fooprintsusage: /quit [--delete]and does not exitChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings)cli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/AScreenshots / Logs