From ab37440ce660e54507499288b4510cdc5e43de47 Mon Sep 17 00:00:00 2001 From: alt-glitch Date: Fri, 12 Jun 2026 09:28:15 +0530 Subject: [PATCH] =?UTF-8?q?opentui(v6):=20diagnostics-gate=20review=20nits?= =?UTF-8?q?=20=E2=80=94=20completion-mechanism=20precision=20+=20client-on?= =?UTF-8?q?ly=20design=20note?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/opentui-env-flags.md | 4 ++-- ui-opentui/src/logic/slash.ts | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/opentui-env-flags.md b/docs/opentui-env-flags.md index aa5b658c0a3..5f947a53ce4 100644 --- a/docs/opentui-env-flags.md +++ b/docs/opentui-env-flags.md @@ -9,14 +9,14 @@ classified by who should ever touch it. The design rule shipped with this doc: | var | default | effect | |---|---|---| -| `HERMES_TUI_DIAGNOSTICS` | **off** | Enables the diagnostic slash commands (`/mem`, `/heapdump`) — hidden from `/help` and completion otherwise, and invoking them while off prints the enable hint rather than executing. Also flips the *default* of `HERMES_TUI_WINDOW_STATS` to on. Not a secret — support flows are "relaunch with `HERMES_TUI_DIAGNOSTICS=1`". | +| `HERMES_TUI_DIAGNOSTICS` | **off** | Enables the diagnostic slash commands (`/mem`, `/heapdump`). While off they're hidden from `/help` (client-side filter) and invoking them prints the enable hint rather than executing. They never appear in slash *completion* in either state — completion is gateway-driven and these are client-only commands the gateway doesn't know (an adversarial review confirmed there's no bypass path; if a SERVER command named `mem`/`heapdump` is ever added it must be gated gateway-side too — the client gate would shadow but not hide it). Also flips the *default* of `HERMES_TUI_WINDOW_STATS` to on. Not a secret — support flows are "relaunch with `HERMES_TUI_DIAGNOSTICS=1`". | ## 2. User-facing configuration (fine to document publicly) | var | default | effect | |---|---|---| | `HERMES_TUI_ENGINE` | auto (`opentui` if Node≥26.3 + built, else `ink`) | Engine pick; also `display.tui_engine` in config.yaml. | -| `HERMES_TUI_MOUSE` | on (launcher sets it) | Mouse support (wheel scroll, selection, click-to-expand). | +| `HERMES_TUI_MOUSE` | on (launcher sets it) | Mouse support (wheel scroll, selection, click-to-expand). **Glitch verdict 2026-06-12: leave as-is — always on, no realistic reason to disable; treat as plumbing, don't document it user-facing.** | | `HERMES_TUI_MAX_MESSAGES` | ceiling | Scrollback rows kept in the TUI. Can LOWER the ceiling, never raise: 3000 with windowing, 1000 with windowing off (handle-table safety). | | `HERMES_TUI_TOOL_OUTPUT_LINES` | unlimited | Cap expanded tool-output lines (set a number to restore a cap). | | `HERMES_TUI_COMPOSER_ROWS` | default rows | Composer height. | diff --git a/ui-opentui/src/logic/slash.ts b/ui-opentui/src/logic/slash.ts index 2b448a5bdb6..f31b6f7a1f6 100644 --- a/ui-opentui/src/logic/slash.ts +++ b/ui-opentui/src/logic/slash.ts @@ -152,7 +152,11 @@ function present(ctx: SlashContext, title: string, text: string): void { /** Process-diagnostic commands — hidden behind `HERMES_TUI_DIAGNOSTICS` * (logic/env.ts). Regular users never see them; support flows enable them - * with one env var. Keep this set in sync with the `(diag)` lines below. */ + * with one env var. Keep this set in sync with the `(diag)` lines below. + * DESIGN ASSUMPTION (review 2026-06-12): these stay CLIENT-ONLY. Completion + * is gateway-driven and hides them only because the gateway doesn't know + * them — adding a server command with one of these names requires gating it + * gateway-side too (the early return below would shadow, not hide, it). */ const DIAGNOSTIC_COMMANDS = new Set(['mem', 'heapdump']) const CLIENT_HELP_LINES = [