The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop): /reasoning hide|show gates Thinking blocks immediately
teknium10c3ebefb5e02
diff --git a/apps/desktop/src/app/session/hooks/use-prompt-actions/slash.ts b/apps/desktop/src/app/session/hooks/use-prompt-actions/slash.tsindex db873644551..876ea7d9f30 100644--- a/apps/desktop/src/app/session/hooks/use-prompt-actions/slash.ts+++ b/apps/desktop/src/app/session/hooks/use-prompt-actions/slash.ts@@ -17,6 +17,7 @@ import {resolveDesktopCommand} from '@/lib/desktop-slash-commands'import { isMissingRpcMethod } from '@/lib/gateway-rpc'+import { applyReasoningSlashResult, reasoningSlashParams } from '@/lib/reasoning-slash'import { setSessionYolo } from '@/lib/yolo-session'import { openCommandPalettePage } from '@/store/command-palette'import { setComposerDraft } from '@/store/composer'@@ -771,6 +772,46 @@ export function useSlashCommand(deps: SlashCommandDeps) {compressInFlightRef.current.delete(sessionId)}},+ // /reasoning runs the gateway's `config.set key=reasoning` — the Ink+ // TUI's path. Through slash.exec the display words only reached+ // config.yaml and the Thinking gate ($showReasoning) waited for the+ // next config refresh; the effort level was set on a throwaway CLI.+ reasoning: async ctx => {+ const resolved = await withSlashOutput(ctx)++ if (!resolved) {+ return+ }++ const { render: renderSlashOutput, sessionId } = resolved+ const params = reasoningSlashParams(ctx.arg, sessionId)++ try {+ if (!params) {+ const current = await requestGateway<{ display?: string; value?: string }>('config.get', {+ key: 'reasoning',+ session_id: sessionId+ })++ renderSlashOutput(`reasoning: ${current.value || 'medium'} · display ${current.display || 'hide'}`)++ return+ }++ const result = await requestGateway<{ value?: string }>('config.set', params)++ applyReasoningSlashResult(result.value)+ renderSlashOutput(`reasoning: ${result.value || params.value}`)+ } catch (err) {+ if (isMissingRpcMethod(err)) {+ await runExec(ctx)++ return+ }++ renderSlashOutput(`error: ${err instanceof Error ? err.message : String(err)}`)+ }+ },// /yolo maps to the status-bar YOLO control — a per-session approval// bypass, same scope as the TUI's Shift+Tab. With no session yet we arm// it locally; the session-create path applies it on the first message.diff --git a/apps/desktop/src/lib/desktop-slash-commands.ts b/apps/desktop/src/lib/desktop-slash-commands.tsindex f1decc521d1..b3e3668c43b 100644--- a/apps/desktop/src/lib/desktop-slash-commands.ts+++ b/apps/desktop/src/lib/desktop-slash-commands.ts@@ -66,6 +66,7 @@ export type DesktopActionId =| 'new'| 'pet'| 'profile'+ | 'reasoning'| 'skin'| 'stop'| 'title'@@ -188,6 +189,12 @@ const DESKTOP_COMMAND_SPECS: readonly DesktopCommandSpec[] = [surface: action('branch')},{ name: '/yolo', description: 'Toggle YOLO — auto-approve dangerous commands', surface: action('yolo') },+ {+ name: '/reasoning',+ description: 'Reasoning effort or display [<level> [--global]|show|hide|full|clamp]',+ surface: action('reasoning'),+ argumentMode: 'options'+ },{name: '/wake',description: 'Control the desktop wake-word listener [on|off|status]',diff --git a/apps/desktop/src/lib/desktop-slash-registry.json b/apps/desktop/src/lib/desktop-slash-registry.jsonindex d8a05d279d3..91917627df7 100644--- a/apps/desktop/src/lib/desktop-slash-registry.json+++ b/apps/desktop/src/lib/desktop-slash-registry.json@@ -22,7 +22,6 @@"/platforms": "terminal","/plugins": "terminal","/quit": "terminal",- "/reasoning": "advanced","/redraw": "terminal","/reload": "terminal","/reload-mcp": "advanced",diff --git a/apps/desktop/src/lib/reasoning-slash.test.ts b/apps/desktop/src/lib/reasoning-slash.test.tsnew file mode 100644index 00000000000..755e6944eaf--- /dev/null+++ b/apps/desktop/src/lib/reasoning-slash.test.ts@@ -0,0 +1,36 @@+import { describe, expect, it } from 'vitest'++import { resolveDesktopCommand } from '@/lib/desktop-slash-commands'+import { applyReasoningSlashResult, reasoningSlashParams } from '@/lib/reasoning-slash'+import { $showReasoning, setShowReasoningFromConfig } from '@/store/reasoning-disclosure'++// `/reasoning hide` typed into the Desktop composer must gate Thinking blocks+// in the transcript immediately (#111761, #49664): the renderer mirrors the+// gateway's `config.set key=reasoning` answer instead of waiting for the next+// config refresh.+describe('/reasoning slash command', () => {+ it('runs as a desktop action instead of the slash worker', () => {+ expect(resolveDesktopCommand('/reasoning')?.surface.kind).toBe('action')+ })++ it('builds the gateway config.set payload, honoring the scope flags', () => {+ expect(reasoningSlashParams('hide', 's1')).toEqual({ key: 'reasoning', session_id: 's1', value: 'hide' })+ expect(reasoningSlashParams('high --global', 's1')).toEqual({+ key: 'reasoning',+ scope: 'global',+ session_id: 's1',+ value: 'high'+ })+ expect(reasoningSlashParams(' ', 's1')).toBeNull()+ })++ it('flips the Thinking gate on hide/show and leaves it alone for effort levels', () => {+ setShowReasoningFromConfig(true)+ applyReasoningSlashResult('hide')+ expect($showReasoning.get()).toBe(false)+ applyReasoningSlashResult('high')+ expect($showReasoning.get()).toBe(false)+ applyReasoningSlashResult('show')+ expect($showReasoning.get()).toBe(true)+ })+})diff --git a/apps/desktop/src/lib/reasoning-slash.ts b/apps/desktop/src/lib/reasoning-slash.tsnew file mode 100644index 00000000000..71f8c5ac494--- /dev/null+++ b/apps/desktop/src/lib/reasoning-slash.ts@@ -0,0 +1,53 @@+import { setShowReasoningFromConfig } from '@/store/reasoning-disclosure'++// `/reasoning` typed into the composer — the Ink TUI's path+// (ui-tui/src/app/slash/commands/session.ts). The gateway's `config.set+// key=reasoning` handles both the display words (show/hide/full/clamp) and the+// effort levels; through `slash.exec` the words only reached config.yaml and+// the transcript kept rendering Thinking until the next config refresh.++const GLOBAL_FLAGS = new Set(['--global', '-g', 'global'])+const SESSION_FLAGS = new Set(['--session', '-s', 'session'])++export type ReasoningSlashParams = {+ key: 'reasoning'+ scope?: 'global' | 'session'+ session_id: string+ value: string+}++/** Build the `config.set` params for `/reasoning <arg>`; `null` when there is nothing to set. */+export function reasoningSlashParams(arg: string, sessionId: string): null | ReasoningSlashParams {+ let scope: ReasoningSlashParams['scope']+ const values: string[] = []++ for (const part of arg.trim().split(/\s+/).filter(Boolean)) {+ const flag = part.toLowerCase()++ if (GLOBAL_FLAGS.has(flag)) {+ scope = 'global'+ } else if (SESSION_FLAGS.has(flag)) {+ scope = 'session'+ } else {+ values.push(part)+ }+ }++ if (!values.length) {+ return null+ }++ return { key: 'reasoning', session_id: sessionId, value: values.join(' '), ...(scope ? { scope } : {}) }+}++/**+ * Mirror the gateway's answer into the renderer: `hide`/`show` are the+ * `display.show_reasoning` words; effort levels leave the display gate alone.+ */+export function applyReasoningSlashResult(value: unknown): void {+ if (value === 'hide') {+ setShowReasoningFromConfig(false)+ } else if (value === 'show') {+ setShowReasoningFromConfig(true)+ }+}diff --git a/hermes_cli/commands.py b/hermes_cli/commands.pyindex e87d9b4699f..47fd759bb8b 100644--- a/hermes_cli/commands.py+++ b/hermes_cli/commands.py@@ -187,8 +187,7 @@ COMMAND_REGISTRY: list[CommandDef] = [subcommands=("manual", "smart", "off")),CommandDef("reasoning", "Manage reasoning effort and display", "Configuration",args_hint="[level|show|hide|full|clamp] [--global]",- subcommands=("none", "minimal", "low", "medium", "high", "xhigh", "max", "ultra", "show", "hide", "on", "off", "full", "clamp", "--global"),- desktop="advanced"),+ subcommands=("none", "minimal", "low", "medium", "high", "xhigh", "max", "ultra", "show", "hide", "on", "off", "full", "clamp", "--global")),CommandDef("fast", "Fast mode — OpenAI Priority Processing / Anthropic Fast Mode (normal/fast/auto/cold)", "Configuration",args_hint="[normal|fast|auto|cold|status] [--global]",subcommands=("normal", "fast", "auto", "cold", "status", "on", "off", "--global"),diff --git a/website/docs/user-guide/desktop.md b/website/docs/user-guide/desktop.mdindex fc77e3ce876..8beec726cf7 100644--- a/website/docs/user-guide/desktop.md+++ b/website/docs/user-guide/desktop.md@@ -196,7 +196,7 @@ Manage providers, models, tools, and credentials from a real UI instead of editi- **xAI Grok OAuth** — Grok is a first-class OAuth provider in the launcher; sign in through the browser flow like the other OAuth providers.- **Tool-backend installs from the GUI** — run a tool backend's post-setup install steps directly from the app instead of dropping to a terminal. In the terminal backend picker, selecting a backend marked **Needs setup** asks for confirmation first; declining leaves the current backend selected.- **Terminal font picker** — choose an installed font in **Settings → Appearance**. Nerd Fonts such as `MesloLGS NF` render Powerlevel10k separators and icons in both interactive and agent terminals; the setting is saved per profile.-- **Reasoning Blocks** — **Settings → Chat → Reasoning Blocks** (`display.show_reasoning` in `config.yaml`) shows or hides the model's thinking in the transcript (off shows answers only). Open chats update as soon as the setting saves.+- **Reasoning Blocks** — **Settings → Chat → Reasoning Blocks** (`display.show_reasoning` in `config.yaml`) shows or hides the model's thinking in the transcript (off shows answers only). Open chats update as soon as the setting saves. Typing `/reasoning hide` or `/reasoning show` in the composer flips the same setting and the open transcript follows immediately.- **Reopen Last Chat on Launch** — by default the app picks up where you left off on cold start. Turn it off in **Settings → Appearance** (or set `display.resume_last_session: false` in `config.yaml`) to always begin with a fresh chat. Deep links and explicit destinations are never overridden either way.- **Auxiliary-model warning** — if you switch the main model to a new provider while auxiliary tasks (titling, summarization, and similar helpers) are still pinned to another provider, the app warns you so you don't unknowingly split work across two providers.- **Per-task reasoning effort** — each row under **Settings → Model → Auxiliary models** has a reasoning selector next to its provider/model pick: a level, **Off**, or **inherit · main model effort** (the default, which removes the task's override). It is saved as `auxiliary.<task>.reasoning_effort` in `config.yaml`, the same key `hermes model` writes, and shows in the row's summary when set. Use it to run frequent helpers such as compression or titling at low or no reasoning while the main agent stays at high.