The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
feat(gateway): serve TUI display prefs, /theme and /indicator config.set on the owner
Teknium831dcba86346
diff --git a/apps/shared/src/gateway-contract.generated.ts b/apps/shared/src/gateway-contract.generated.tsindex 8d849fd510b..738781ea656 100644--- a/apps/shared/src/gateway-contract.generated.ts+++ b/apps/shared/src/gateway-contract.generated.ts@@ -5056,11 +5056,11 @@ export interface CanonicalConfigGetResult {key?: string | nullscope?: string | null}-/** ``model`` is recognised only to be refused with ``use_session_mutation_model``: a model pick is the revision-fenced ``session.mutate`` operation, never a config write. */+/** Session controls (``busy`` / ``verbose`` / ``yolo`` / ``show_reasoning`` / ``service_tier``, which need ``session_id``) and the TUI's profile preferences (``gateway/session_tui_config.py``; ``session_id`` optional). ``model`` is recognised only to be refused with ``use_session_mutation_model``: a model pick is the revision-fenced ``session.mutate`` operation, never a config write. */export interface CanonicalConfigSetParams {profile?: string | null- session_id: string- key: 'busy' | 'verbose' | 'yolo' | 'show_reasoning' | 'service_tier' | 'model'+ session_id?: string | null+ key: stringvalue?: unknownconfirm_expensive_model?: boolean | null}diff --git a/apps/shared/src/gateway-contract.openrpc.json b/apps/shared/src/gateway-contract.openrpc.jsonindex c3d9c97cfdf..c496c43e819 100644--- a/apps/shared/src/gateway-contract.openrpc.json+++ b/apps/shared/src/gateway-contract.openrpc.json@@ -8380,7 +8380,7 @@},"CanonicalConfigSetParams": {"additionalProperties": false,- "description": "``model`` is recognised only to be refused with ``use_session_mutation_model``: a model pick is\nthe revision-fenced ``session.mutate`` operation, never a config write.",+ "description": "Session controls (``busy`` / ``verbose`` / ``yolo`` / ``show_reasoning`` / ``service_tier``, which\nneed ``session_id``) and the TUI's profile preferences (``gateway/session_tui_config.py``;\n``session_id`` optional). ``model`` is recognised only to be refused with\n``use_session_mutation_model``: a model pick is the revision-fenced ``session.mutate`` operation,\nnever a config write.","properties": {"profile": {"anyOf": [@@ -8395,18 +8395,18 @@"title": "Profile"},"session_id": {- "title": "Session Id",- "type": "string"+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ],+ "default": null,+ "title": "Session Id"},"key": {- "enum": [- "busy",- "verbose",- "yolo",- "show_reasoning",- "service_tier",- "model"- ],"title": "Key","type": "string"},@@ -8428,7 +8428,6 @@}},"required": [- "session_id","key"],"title": "CanonicalConfigSetParams",diff --git a/gateway/session_controls.py b/gateway/session_controls.pyindex 2f5e01ed457..46f21851fbb 100644--- a/gateway/session_controls.py+++ b/gateway/session_controls.py@@ -107,6 +107,8 @@ class AuthorityConnection:handlers.update(busy_handlers(self))from gateway.session_config import handlers as config_handlershandlers.update(config_handlers(self))+ from gateway.session_tui_config import handlers as tui_config_handlers+ handlers.update(tui_config_handlers(self))from gateway.session_ancillary import handlers as ancillary_handlershandlers.update(ancillary_handlers(self))from gateway.session_shell import handlers as shell_handlersdiff --git a/gateway/session_tui_config.py b/gateway/session_tui_config.pynew file mode 100644index 00000000000..24200712735--- /dev/null+++ b/gateway/session_tui_config.py@@ -0,0 +1,174 @@+"""Owner ``config.set`` for the TUI's profile preferences.++Main served these from the per-TUI sidecar (``tui_gateway/methods_config_set.py``); on the shared+owner they write the OWNING profile's config.yaml (raw round-trip, off-loop, under its runtime+scope) with main's per-key semantics. The session controls (busy/verbose/yolo/show_reasoning/+service_tier, the refused ``model``) stay in ``gateway.session_busy_controls``; any other key is+``invalid_params``.+"""+import asyncio+import copy+from functools import partial+from pathlib import Path+import threading++from hermes_state_runtime import RuntimeStoreError++_SESSION_CONTROL_KEYS = frozenset({'busy', 'verbose', 'yolo', 'show_reasoning', 'service_tier', 'model'})+_DETAIL_SECTIONS = ('thinking', 'tools', 'subagents', 'activity')+_DETAIL_MODES = frozenset({'hidden', 'collapsed', 'expanded'})+_STATUSBAR_MODES = ('off', 'top', 'bottom')+_BOOL_WORDS = {'on': True, 'true': True, 'yes': True, 'off': False, 'false': False, 'no': False}+_WRITE_LOCK = threading.Lock() # one read-modify-write of config.yaml at a time+++def handlers(connection):+ return {'config.set': partial(config_set, connection)}+++def _word(value):+ return ('' if value is None else str(value)).strip().lower()+++def _statusbar(raw):+ return 'off' if raw is False else raw.strip().lower() if (+ isinstance(raw, str) and raw.strip().lower() in _STATUSBAR_MODES) else 'top'+++def _toggles():+ """key -> (display field, word -> value, flipped(display), report(value)); '' / toggle flips."""+ from tui_gateway.agent_factory import _MOUSE_TRACKING_ALIASES, _display_mouse_tracking++ def on_off(value):+ return 'on' if value else 'off'++ return {+ 'density': ('tui_compact', {'on': True, 'off': False},+ lambda d: not bool(d.get('tui_compact', False)), on_off),+ 'battery': ('battery', _BOOL_WORDS, lambda d: not bool(d.get('battery', False)), on_off),+ 'statusbar': ('tui_statusbar', {'on': 'top', **{m: m for m in _STATUSBAR_MODES}},+ lambda d: 'top' if _statusbar(d.get('tui_statusbar', 'top')) == 'off' else 'off', str),+ 'mouse': ('mouse_tracking', _MOUSE_TRACKING_ALIASES,+ lambda d: 'all' if _display_mouse_tracking(d) == 'off' else 'off', str)}+++def _words():+ """key -> (display field, accepted words)."""+ from hermes_constants import INDICATOR_STYLES+ return {'theme': ('tui_theme', frozenset({'auto', 'light', 'dark'})),+ 'indicator': ('tui_status_indicator', frozenset(INDICATOR_STYLES))}+++def _display(cfg):+ if not isinstance(cfg.get('display'), dict):+ cfg['display'] = {}+ return cfg['display']+++def _sections(display):+ if not isinstance(display.get('sections'), dict):+ display['sections'] = {}+ return display['sections']+++def _set_display(cfg, key, value):+ """One display preference on the raw config, main's semantics; returns the result extras."""+ display, raw = _display(cfg), _word(value)+ if key in (toggles := _toggles()):+ field, aliases, flipped, report = toggles[key]+ new = flipped(display) if raw in ('', 'toggle') else aliases.get(raw)+ if new is None:+ raise RuntimeStoreError('invalid_params')+ display[field] = new+ return {'value': report(new)}+ if key in (words := _words()):+ field, allowed = words[key]+ if raw not in allowed:+ raise RuntimeStoreError('invalid_params')+ display[field] = raw+ return {'value': raw}+ if key == 'details_mode':+ if raw not in _DETAIL_MODES:+ raise RuntimeStoreError('invalid_params')+ display['details_mode'] = raw+ _sections(display).update(dict.fromkeys(_DETAIL_SECTIONS, raw))+ return {'value': raw}+ if key.startswith('details_mode.'):+ section = key.split('.', 1)[1]+ if section not in _DETAIL_SECTIONS or (raw and raw not in _DETAIL_MODES):+ raise RuntimeStoreError('invalid_params')+ if raw:+ _sections(display)[section] = raw+ else: # empty clears the override (the client falls back to its section default)+ _sections(display).pop(section, None)+ return {'value': raw}+ if key == 'focus':+ return _set_focus(display, raw)+ raise RuntimeStoreError('invalid_params')+++def _set_focus(display, raw):+ """/focus on stashes the configured tool-progress mode and pins it off; off restores it."""+ from hermes_cli.focus_view import FOCUS_TOOL_PROGRESS_MODE, normalize_tool_progress_mode, resolve_focus_arg+ current = bool(display.get('focus_view', False))+ configured = normalize_tool_progress_mode(display.get('tool_progress', 'all'))+ action, target = resolve_focus_arg(raw, current)+ if action == 'usage':+ raise RuntimeStoreError('invalid_params')+ if action == 'status' or target is None:+ return {'value': 'on' if current else 'off', 'tool_progress': configured}+ if target:+ display['focus_saved_tool_progress'] = normalize_tool_progress_mode(+ (current and display.get('focus_saved_tool_progress')) or configured)+ effective = FOCUS_TOOL_PROGRESS_MODE+ else:+ effective = normalize_tool_progress_mode(display.get('focus_saved_tool_progress') or 'all')+ display['tool_progress'], display['focus_view'] = effective, bool(target)+ return {'value': 'on' if target else 'off', 'tool_progress': effective}+++def _write_profile_config(connection, edit):+ """``edit(raw_cfg)`` on the owning profile's config.yaml EXACTLY as written (no defaults or+ overlay persisted); saved only when it changed. Runs off the loop."""+ from gateway.run import _profile_runtime_scope+ from hermes_cli.config import atomic_config_replace, get_config_path, read_user_config_raw+ with _profile_runtime_scope(Path(connection.authority.profile_id)), _WRITE_LOCK:+ path = get_config_path()+ try:+ cfg = read_user_config_raw(path)+ except Exception as exc: # unparseable: never overwrite the user's file+ raise RuntimeStoreError('storage_unavailable') from exc+ before = copy.deepcopy(cfg)+ result = edit(cfg)+ if cfg != before:+ try:+ atomic_config_replace(path, cfg)+ except Exception as exc:+ raise RuntimeStoreError('storage_unavailable') from exc+ return result+++def _authorize_write(connection, ref, params):+ """Profile-level like ``config.get`` (a session is optional), plus the control capability."""+ from gateway.session_config import _authorize+ policy = _authorize(connection, ref, params)+ if 'session:control' not in connection.actor.capabilities:+ raise RuntimeStoreError('permission_denied')+ return policy+++async def config_set(connection, ref, params):+ key = params.get('key')+ if key in _SESSION_CONTROL_KEYS or not isinstance(key, str):+ from gateway.session_busy_controls import busy_config+ return await busy_config(connection, ref, params, write=True)+ if set(params) - {'session_id', 'profile', 'key', 'value'}:+ raise RuntimeStoreError('invalid_params')+ _authorize_write(connection, ref, params)+ value = params.get('value')+ result = await asyncio.to_thread(_write_profile_config, connection,+ lambda cfg: _set_display(cfg, key, value))+ if key == 'focus' and ref.session_id and 'tool_progress' in result:+ # Main's session also took the focus mode at once: this session's /verbose state.+ connection.authority.sessions[ref.session_id].tool_progress_mode = result['tool_progress']+ return {'key': key, **result}diff --git a/tests/gateway/test_session_tui_config.py b/tests/gateway/test_session_tui_config.pynew file mode 100644index 00000000000..578592846b9--- /dev/null+++ b/tests/gateway/test_session_tui_config.py@@ -0,0 +1,58 @@+"""The TUI's profile preferences (/statusbar /mouse /density /details /focus /battery /theme+/indicator) are written by the shared owner into the OWNING profile's config.yaml, like main's+per-TUI sidecar ``config.set`` — never refused, never inference."""+import asyncio++import hermes_yaml as yaml+import pytest++from tests.gateway.test_session_busy_controls import owner, admissions+from tests.gateway.fixtures.local_recovery_probe import rpc, websocket+++def _display(home):+ return yaml.safe_load((home / 'config.yaml').read_text()).get('display', {})++[email protected]("linux")+def test_display_preferences_theme_and_indicator_persist_to_the_profile(tmp_path):+ with owner(tmp_path) as (home, peer, desc):+ async def probe():+ async with websocket(home, desc) as ws:+ sid = (await rpc(ws, 'session.create', request_id='prefs', source='tui',+ toolsets=[]))['result']['session_id']+ # Main's TUI sends display preferences without a session (profile-wide).+ for key, value, reported in [+ ('statusbar', 'off', 'off'), ('mouse', 'wheel', 'wheel'), ('density', 'on', 'on'),+ ('battery', 'on', 'on'), ('details_mode', 'expanded', 'expanded'),+ ('details_mode.tools', 'hidden', 'hidden'), ('theme', 'dark', 'dark'),+ ('indicator', 'ascii', 'ascii'),+ ]:+ result = await rpc(ws, 'config.set', key=key, value=value)+ assert result.get('result') == {'key': key, 'value': reported}, (key, result)+ focus = await rpc(ws, 'config.set', key='focus', value='on', session_id=sid)+ assert focus.get('result') == {'key': 'focus', 'value': 'on', 'tool_progress': 'off'}, focus+ display = _display(home)+ assert display['tui_statusbar'] == 'off' and display['mouse_tracking'] == 'wheel'+ assert display['tui_compact'] is True and display['battery'] is True+ assert display['details_mode'] == 'expanded'+ assert display['sections'] == {'thinking': 'expanded', 'tools': 'hidden',+ 'subagents': 'expanded', 'activity': 'expanded'}+ assert display['tui_theme'] == 'dark' and display['tui_status_indicator'] == 'ascii'+ assert display['focus_view'] is True and display['tool_progress'] == 'off'+ # /focus also pins this session's tool-progress mode, as main's session did.+ assert (await rpc(ws, 'config.get', key='verbose', session_id=sid))['result']['value'] == 'off'+ assert (await rpc(ws, 'config.get', key='theme'))['result']['value'] == 'dark'+ assert (await rpc(ws, 'config.get', key='indicator'))['result']['value'] == 'ascii'+ for params, reason in [+ ({'key': 'theme', 'value': 'neon'}, 'invalid_params'),+ ({'key': 'indicator', 'value': 'sparkles'}, 'invalid_params'),+ ({'key': 'details_mode.nope', 'value': 'hidden'}, 'invalid_params'),+ ({'key': 'approvals.mode', 'value': 'off'}, 'invalid_params'),+ ({'key': 'theme', 'value': 'dark', 'profile': 'foreign'}, 'profile_mismatch'),+ ({'key': 'model', 'value': 'x', 'session_id': sid}, 'use_session_mutation_model'),+ ]:+ assert (await rpc(ws, 'config.set', **params)).get('error', {}).get('message') == reason, params+ assert _display(home)['tui_theme'] == 'dark'+ assert not admissions(home) and not peer.requests+ asyncio.run(probe())diff --git a/tui_gateway/contracts/canonical_projections.py b/tui_gateway/contracts/canonical_projections.pyindex a2fd5eb1390..bb3020a4253 100644--- a/tui_gateway/contracts/canonical_projections.py+++ b/tui_gateway/contracts/canonical_projections.py@@ -16,11 +16,15 @@ class CanonicalConfigGetResult(ConfigGetResult):scope: str | None = None-class CanonicalConfigSetParams(CanonicalSessionParams):- """``model`` is recognised only to be refused with ``use_session_mutation_model``: a model pick is- the revision-fenced ``session.mutate`` operation, never a config write."""+class CanonicalConfigSetParams(ProfileParams):+ """Session controls (``busy`` / ``verbose`` / ``yolo`` / ``show_reasoning`` / ``service_tier``, which+ need ``session_id``) and the TUI's profile preferences (``gateway/session_tui_config.py``;+ ``session_id`` optional). ``model`` is recognised only to be refused with+ ``use_session_mutation_model``: a model pick is the revision-fenced ``session.mutate`` operation,+ never a config write."""- key: Literal['busy', 'verbose', 'yolo', 'show_reasoning', 'service_tier', 'model']+ session_id: str | None = None+ key: strvalue: JsonValue = Noneconfirm_expensive_model: bool | None = Nonediff --git a/ui-tui/src/__tests__/canonicalDisplayPrefs.test.ts b/ui-tui/src/__tests__/canonicalDisplayPrefs.test.tsindex 642a24a055a..d82c86d1ae6 100644--- a/ui-tui/src/__tests__/canonicalDisplayPrefs.test.ts+++ b/ui-tui/src/__tests__/canonicalDisplayPrefs.test.ts@@ -15,17 +15,10 @@ const COMMANDS = ['/battery on']-// The shared gateway's config.set accepts only busy/verbose/yolo/model, and these commands-// swallowed its refusal: the view changed, the notice said nothing, and the preference was gone-// on the next launch.+// Main persisted these through config.set; the shared owner serves the same keys profile-wide+// (gateway/session_tui_config.py), so a canonical TUI saves them too instead of dropping them.function harness(isCanonical: boolean) {- const request = vi.fn(async (method: string, params: any) => {- if (method === 'config.set' && isCanonical) {- throw new Error(`invalid_params: ${params.key}`)- }-- return { value: params?.value }- })+ const request = vi.fn(async (_method: string, params: any) => ({ key: params?.key, value: params?.value }))const sys = vi.fn()@@ -53,7 +46,7 @@ beforeEach(() => {patchUiState({ sid: 'owner' })})-it('display preferences apply to the view and say they are not saved on the shared gateway', async () => {+it('the shared gateway persists display preferences through config.set and prints main\'s text', async () => {const { notices, request, slash } = harness(true)for (const cmd of COMMANDS) {@@ -62,7 +55,15 @@ it('display preferences apply to the view and say they are not saved on the sharawait flush()- expect(request.mock.calls.filter(([method]) => method === 'config.set')).toEqual([])+ expect(request.mock.calls.filter(([method]) => method === 'config.set').map(([, params]) => params)).toEqual([+ { key: 'mouse', value: 'off' },+ { key: 'density', value: 'on' },+ { key: 'details_mode', value: 'expanded' },+ { key: 'details_mode.tools', value: 'hidden' },+ { key: 'focus', session_id: 'owner', value: 'on' },+ { key: 'statusbar', value: 'off' },+ { key: 'battery', value: 'on' }+ ])expect(getUiState()).toMatchObject({battery: true,compact: true,@@ -70,10 +71,8 @@ it('display preferences apply to the view and say they are not saved on the sharmouseTracking: 'off',statusBar: 'off'})-- for (const name of ['mouse', 'density', 'details', 'focus', 'statusbar', 'battery']) {- expect(notices()).toContain(`/${name} applies to this view only; not saved on the shared gateway`)- }+ expect(notices()).toEqual(expect.arrayContaining(['mouse tracking off', 'density on', 'status bar off']))+ expect(notices().some(text => text.includes('not saved'))).toBe(false)})it('a standalone backend still persists them through config.set', async () => {diff --git a/ui-tui/src/__tests__/canonicalSlashCommands.test.ts b/ui-tui/src/__tests__/canonicalSlashCommands.test.tsindex 41cd81364df..be9a5aa27af 100644--- a/ui-tui/src/__tests__/canonicalSlashCommands.test.ts+++ b/ui-tui/src/__tests__/canonicalSlashCommands.test.ts@@ -63,6 +63,10 @@ function harness() {return { value: params.key === 'skin' ? 'default' : 'auto' }}+ if (method === 'config.set') {+ return { key: params.key, value: params.value }+ }+if (method === 'slash.exec' && params.command === 'status') {return { output: 'Session: owner' }}@@ -199,8 +203,7 @@ it('/stop is session-scoped; process-global /reload-mcp refuses on the shared gait('setting writes the shared gateway has no verb for say so instead of a bare invalid_params; reads still work', async () => {const { request, slash, sys } = harness()- // dokterdok P3: the canonical config.set accepts only busy / verbose / yolo / model.- for (const cmd of ['/theme dark', '/skin mono', '/indicator ascii', '/reasoning high --global', '/fast fast', '/personality pirate', '/skin']) {+ for (const cmd of ['/reasoning high --global', '/skin mono', '/fast fast', '/personality pirate', '/skin']) {slash(cmd)}@@ -211,13 +214,31 @@ it('setting writes the shared gateway has no verb for say so instead of a bare iconst notices = sys.mock.calls.map(([text]) => String(text))- for (const name of ['theme', 'skin', 'indicator', 'reasoning', 'fast', 'personality']) {+ for (const name of ['reasoning', 'skin', 'fast', 'personality']) {expect(notices).toContain(`/${name} is not available on the shared gateway yet`)}expect(notices.some(line => /skin: default/.test(line))).toBe(true)})+it('/theme and /indicator write the profile through the owner\'s config.set like main', async () => {+ const { request, slash, sys } = harness()++ slash('/theme dark')+ await flush()+ slash('/indicator ascii')+ await flush()++ expect(request).toHaveBeenCalledWith('config.set', { key: 'theme', value: 'dark' })+ expect(request).toHaveBeenCalledWith('config.set', { key: 'indicator', value: 'ascii' })++ const notices = sys.mock.calls.map(([text]) => String(text))++ expect(notices).toEqual(expect.arrayContaining(['theme → dark', 'indicator → ascii']))+ expect(notices.some(line => /not available/.test(line))).toBe(false)+ expect(getUiState().indicatorStyle).toBe('ascii')+})+it('session /reasoning <level> is the owner\'s fenced reasoning mutation (B14); display words still refuse', async () => {const { request, slash, sys } = harness()diff --git a/ui-tui/src/app/slash/commands/core.ts b/ui-tui/src/app/slash/commands/core.tsindex 57255aa51f3..6a733ab64f7 100644--- a/ui-tui/src/app/slash/commands/core.ts+++ b/ui-tui/src/app/slash/commands/core.ts@@ -30,15 +30,13 @@ import { patchUiState } from '../../uiStore.js'import { canonicalRewind, canonicalTitle } from '../canonicalSessionCommands.js'import type { SlashCommand, SlashRunCtx } from '../types.js'-// Client display preferences. The shared gateway's config.set covers only session controls-// (busy/verbose/yolo/model), so there the change applies to this view and is not saved;-// say so after the command's own notice instead of a bare invalid_params.-const saveDisplayPref = (ctx: SlashRunCtx, command: string, key: string, value: string) => {- if (ctx.gateway.gw?.isCanonical) {- return queueMicrotask(() => ctx.transcript.sys(t('canonical.controls.prefNotSaved', command)))- }+// Client display preferences: written to the profile's config.yaml by either backend (the shared+// owner's config.set serves them profile-wide, like the sidecar). `/focus` names the session on the+// shared owner so its tool-progress mode follows at once (the sidecar's session read it from config).+const saveDisplayPref = (ctx: SlashRunCtx, key: string, value: string) => {+ const session = key === 'focus' && ctx.gateway.gw?.isCanonical && ctx.sid ? { session_id: ctx.sid } : {}- ctx.gateway.rpc<ConfigSetResponse>('config.set', { key, value }).catch(() => {})+ ctx.gateway.rpc<ConfigSetResponse>('config.set', { key, value, ...session }).catch(() => {})}const flagFromArg = (arg: string, current: boolean): boolean | null => {@@ -181,7 +179,7 @@ export const coreCommands: SlashCommand[] = [patchUiState({ mouseTracking: next })queueMicrotask(() => ctx.transcript.sys(t('slashCmd.core.mouse.tracking', next)))- saveDisplayPref(ctx, 'mouse', 'mouse', next)+ saveDisplayPref(ctx, 'mouse', next)}},@@ -322,7 +320,7 @@ export const coreCommands: SlashCommand[] = [patchUiState({ compact: next })queueMicrotask(() => ctx.transcript.sys(t('slashCmd.core.density.state', next ? 'on' : 'off')))- saveDisplayPref(ctx, 'density', 'density', next ? 'on' : 'off')+ saveDisplayPref(ctx, 'density', next ? 'on' : 'off')}},@@ -369,7 +367,7 @@ export const coreCommands: SlashCommand[] = [patchUiState({ sections: mode ? { ...rest, [first]: mode } : rest })transcript.sys(t('slashCmd.core.details.section', first, mode ?? t('slashCmd.core.details.reset')))- saveDisplayPref(ctx, 'details', `details_mode.${first}`, mode ?? '')+ saveDisplayPref(ctx, `details_mode.${first}`, mode ?? '')return}@@ -384,7 +382,7 @@ export const coreCommands: SlashCommand[] = [patchUiState({ detailsMode: next, detailsModeCommandOverride: true, sections })transcript.sys(t('slashCmd.core.details.current', next, ''))- saveDisplayPref(ctx, 'details', 'details_mode', next)+ saveDisplayPref(ctx, 'details_mode', next)}},@@ -638,7 +636,7 @@ export const coreCommands: SlashCommand[] = [queueMicrotask(() =>ctx.transcript.sys(next ? t('slashCmd.core.focus.enabled') : t('slashCmd.core.focus.disabled')))- saveDisplayPref(ctx, 'focus', 'focus', next ? 'on' : 'off')+ saveDisplayPref(ctx, 'focus', next ? 'on' : 'off')}},@@ -665,7 +663,7 @@ export const coreCommands: SlashCommand[] = [patchUiState({ statusBar: next })queueMicrotask(() => ctx.transcript.sys(t('slashCmd.core.statusbar.state', next)))- saveDisplayPref(ctx, 'statusbar', 'statusbar', next)+ saveDisplayPref(ctx, 'statusbar', next)}},@@ -705,7 +703,7 @@ export const coreCommands: SlashCommand[] = [patchUiState({ battery: next, ...(next ? {} : { batteryStatus: null }) })queueMicrotask(() => ctx.transcript.sys(t('slashCmd.core.battery.state', next ? 'on' : 'off')))- saveDisplayPref(ctx, 'battery', 'battery', next ? 'on' : 'off')+ saveDisplayPref(ctx, 'battery', next ? 'on' : 'off')}},diff --git a/ui-tui/src/app/slash/commands/session.ts b/ui-tui/src/app/slash/commands/session.tsindex 2721ca7ad97..d5461a83c42 100644--- a/ui-tui/src/app/slash/commands/session.ts+++ b/ui-tui/src/app/slash/commands/session.ts@@ -529,12 +529,6 @@ export const sessionCommands: SlashCommand[] = [return ctx.transcript.sys(t('slashCmd.session.theme.usage'))}- // The shared owner serves this setting's read, not its write (a config.yaml / per-session- // setting it has no frozen-policy verb for yet): say so instead of a bare invalid_params.- if (ctx.gateway.gw?.isCanonical) {- return ctx.transcript.sys(t('canonical.controls.notAvailable', 'theme'))- }-// Apply only after the write is confirmed (mirrors /indicator): a// failed config.set must not leave the session showing a theme that// reverts on restart. A few ms later than an optimistic flip, but the@@ -606,12 +600,6 @@ export const sessionCommands: SlashCommand[] = [return ctx.transcript.sys(t('slashCmd.session.indicator.usage', INDICATOR_STYLES.join('|')))}- // The shared owner serves this setting's read, not its write (a config.yaml / per-session- // setting it has no frozen-policy verb for yet): say so instead of a bare invalid_params.- if (ctx.gateway.gw?.isCanonical) {- return ctx.transcript.sys(t('canonical.controls.notAvailable', 'indicator'))- }-ctx.gateway.rpc<ConfigSetResponse>('config.set', { key: 'indicator', value }).then(ctx.guarded<ConfigSetResponse>(r => {if (!r.value) {diff --git a/ui-tui/src/i18n/en/canonical.ts b/ui-tui/src/i18n/en/canonical.tsindex 69423e9905b..546d4d55037 100644--- a/ui-tui/src/i18n/en/canonical.ts+++ b/ui-tui/src/i18n/en/canonical.ts@@ -13,7 +13,6 @@ export const canonicalEn = {compressedStale: 'compressed transcript is stale; reopen the session',compressed: '✓ transcript compressed',notAvailable: (command: string) => `/${command} is not available on the shared gateway yet`,- prefNotSaved: (command: string) => `/${command} applies to this view only; not saved on the shared gateway`,launchToolsets: (toolsets: string) => `toolsets fixed at session launch: ${toolsets}`,retryUnsupported: '/retry: retry does not support media or unknown content parts'},