From f0c7417002de1c6da0f35fd1c7dca2e54795a9b5 Mon Sep 17 00:00:00 2001 From: kyssta-exe Date: Fri, 12 Jun 2026 00:46:12 +0000 Subject: [PATCH] fix(tui): route /compress command to session.compress handler (#44456) --- tui_gateway/server.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tui_gateway/server.py b/tui_gateway/server.py index e4eb010d4259..f4d1d74eb928 100644 --- a/tui_gateway/server.py +++ b/tui_gateway/server.py @@ -7887,6 +7887,31 @@ def _(rid, params: dict) -> dict: }, ) + # ── Built-in commands that route to dedicated RPC methods ──────── + # These mirror the CLI's slash command handlers. The TUI client + # types e.g. /compress which arrives here via command.dispatch; + # we forward to the canonical session.* RPC so the handler logic + # lives in one place. + if name == "compress": + # Parse optional focus topic from the raw arg. + # /compress → compress full history + # /compress focus:topic → compress with focus + focus_topic = "" + arg_stripped = (arg or "").strip() + if arg_stripped.lower().startswith("focus:"): + focus_topic = arg_stripped[6:].strip() + # Forward to session.compress handler. + handler = _methods.get("session.compress") + if handler: + return handler( + rid, + { + "session_id": params.get("session_id", ""), + "focus_topic": focus_topic, + }, + ) + return _err(rid, 4018, "compress handler not available") + return _err(rid, 4018, f"not a quick/plugin/skill command: {name}")