The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
feat(desktop): make the idle tip rotation opt-in, ungate the tool
Brooklyn Nicholson0357982696cd
diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/desktop-bridge.ts b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/desktop-bridge.tsindex c61a5c7c20d..23f14fbdd87 100644--- a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/desktop-bridge.ts+++ b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/desktop-bridge.ts@@ -217,11 +217,11 @@ export function handleDesktopBridgeEvent(ctx: GatewayEventContext): boolean {if (event.type === 'tip.show') {// tip tool: point the accent bubble at something and say one line about// it. Fire-and-forget — a tip is not a question, and blocking the turn on- // one would stall the sentence the agent is in the middle of. The opt-out- // is enforced inside showTip, so the renderer is the last word on it even- // if a stale config let the tool through. Active session only: a- // background turn must never paint on the user's screen (desktop- // AGENTS.md: offer, don't hijack).+ // one would stall the sentence the agent is in the middle of. Not behind+ // the Appearance switch: that governs the app's own idle rotation, and+ // this is Hermes answering the user mid-conversation, like a tour. Active+ // session only, though: a background turn must never paint on the user's+ // screen (desktop AGENTS.md: offer, don't hijack).const selector = typeof payload?.selector === 'string' ? payload.selector : ''const text = typeof payload?.text === 'string' ? payload.text : ''diff --git a/apps/desktop/src/app/settings/appearance-settings.tsx b/apps/desktop/src/app/settings/appearance-settings.tsxindex 4090bf8915e..d1b22380f47 100644--- a/apps/desktop/src/app/settings/appearance-settings.tsx+++ b/apps/desktop/src/app/settings/appearance-settings.tsx@@ -22,7 +22,7 @@ import { $reactionsEnabled, setReactionsEnabled } from '@/store/reactions-enableimport { $reasoningCollapsedByDefault, setReasoningCollapsedByDefault } from '@/store/reasoning-disclosure'import { $sessionListDensity, type SessionListDensity, setSessionListDensity } from '@/store/session-list-density'import { $tabStripDefault, setTabStripDefault, type TabStripDefault } from '@/store/tabstrip-prefs'-import { $retiredTips, $tipsEnabled, resetTips, setTipsEnabled } from '@/store/tips'+import { $retiredTips, $tipRotationEnabled, resetTips, setTipRotationEnabled } from '@/store/tips'import { $toolViewMode, setToolViewMode } from '@/store/tool-view'import {$translucency,@@ -356,7 +356,7 @@ export function AppearanceSettings() {const translucency = useStore($translucency)const glassMode = translucency.mode === 'glass' && GLASS_SUPPORTEDconst reactionsEnabled = useStore($reactionsEnabled)- const tipsEnabled = useStore($tipsEnabled)+ const tipRotation = useStore($tipRotationEnabled)const retiredTips = useStore($retiredTips)const vibeHeartsEnabled = useStore($vibeHeartsEnabled)const backdrop = useStore($backdrop)@@ -764,13 +764,13 @@ export function AppearanceSettings() {<SegmentedControlonChange={id => {triggerHaptic('selection')- setTipsEnabled(id === 'on')+ setTipRotationEnabled(id === 'on')}}options={[{ id: 'off', label: t.common.off },{ id: 'on', label: t.common.on }]}- value={tipsEnabled ? 'on' : 'off'}+ value={tipRotation ? 'on' : 'off'}/>{/* The ✕ on a tip is permanent, so this is the only way back.It appears once there is something to bring back. */}diff --git a/apps/desktop/src/components/tips/use-tip-rotation.ts b/apps/desktop/src/components/tips/use-tip-rotation.tsindex de8a0285a17..5bb315b0a60 100644--- a/apps/desktop/src/components/tips/use-tip-rotation.ts+++ b/apps/desktop/src/components/tips/use-tip-rotation.ts@@ -1,7 +1,11 @@/*** The rotation's clock: when the app is quiet, offer a tip.*- * "Quiet" is doing the work here. A tip is the app talking unprompted, so it+ * Off unless the user turned it on (Settings → Appearance) — this is the half+ * of the feature that talks unprompted, so it is the half that has to be asked+ * for. An agent tip doesn't come through here at all.+ *+ * "Quiet" is doing the rest of the work. A tip is the app interrupting, so it* waits for a moment that is genuinely idle — nothing streaming, no dialog,* menu or tour on screen, the window focused, and a few seconds since the last* keystroke. Fail any of those and the tick simply passes; a tip is never@@ -15,7 +19,7 @@ import { resolveTipAnchor } from '@/lib/tips/anchor'import { TIP_CATALOG } from '@/lib/tips/catalog'import { nextTip } from '@/lib/tips/rotation'import { $awaitingResponse, $busy } from '@/store/session'-import { $activeTip, $lastTipId, $retiredTips, showTip } from '@/store/tips'+import { $activeTip, $lastTipId, $retiredTips, $tipRotationEnabled, showTip } from '@/store/tips'const TICK_MS = 5_000/** Long enough that the first tip lands after you've settled in, not on boot. */@@ -57,6 +61,10 @@ export function useTipRotation(copy: Translations['tips']) {}const offer = () => {+ if (!$tipRotationEnabled.get()) {+ return+ }+if ($activeTip.get()) {// One is up; the next comes due a good while after it goes away.dueAt = Date.now() + BETWEEN_TIPS_MSdiff --git a/apps/desktop/src/i18n/ar.ts b/apps/desktop/src/i18n/ar.tsindex b8dd49dc2ee..173c290dd52 100644--- a/apps/desktop/src/i18n/ar.ts+++ b/apps/desktop/src/i18n/ar.ts@@ -470,8 +470,7 @@ export const ar = defineLocale({reactionsTitle: 'تفاعلات الرسائل',reactionsDesc: 'تفاعلات إيموجي بأسلوب iMessage — تفاعل مع الرسائل، ويمكن لـ Hermes التفاعل مع رسائلك.',tipsTitle: 'نصائح داخل التطبيق',- tipsDesc:- 'إشارات عرضية إلى أجزاء من التطبيق ربما لم تكتشفها بعد. إغلاق نصيحة يزيلها نهائيًا، ويمكن لـ Hermes أيضًا أن يشير إلى واحدة عند الحاجة.',+ tipsDesc: 'أثناء خمول التطبيق، يشير أحيانًا إلى أجزاء منه ربما لم تكتشفها بعد. إغلاق نصيحة يزيلها نهائيًا.',tipsReset: count => `استعادة ${count} نصيحة مغلقة`,composerPopoutTitle: 'محرر عائم',composerPopoutDesc: 'السماح بسحب محرر الرسائل خارج موضعه. عطّل هذا الخيار لإبقائه مثبتًا في الأسفل.',diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.tsindex a255e8e17f4..846db78f880 100644--- a/apps/desktop/src/i18n/en.ts+++ b/apps/desktop/src/i18n/en.ts@@ -590,7 +590,7 @@ export const en: Translations = {reactionsDesc: 'iMessage-style emoji tapbacks — react to messages, and Hermes can react to yours.',tipsTitle: 'In-App Tips',tipsDesc:- 'Occasional pointers at parts of the app you may not have found yet. Closing one retires it for good; Hermes can also point one out when it helps.',+ 'While the app is idle, occasionally point out a part of it you may not have found yet. Closing a tip retires it for good.',tipsReset: (count: number) => `Bring back ${count} closed ${count === 1 ? 'tip' : 'tips'}`,composerPopoutTitle: 'Floating Composer',composerPopoutDesc: 'Allow dragging the composer out of its dock. Turn this off to keep it locked at the bottom.',diff --git a/apps/desktop/src/i18n/ja.ts b/apps/desktop/src/i18n/ja.tsindex 57ff7cf1149..28c7a631a2c 100644--- a/apps/desktop/src/i18n/ja.ts+++ b/apps/desktop/src/i18n/ja.ts@@ -413,7 +413,7 @@ export const ja = defineLocale({'iMessage風の絵文字タップバック — メッセージにリアクションでき、Hermesもあなたのメッセージにリアクションします。',tipsTitle: 'アプリ内ヒント',tipsDesc:- 'まだ見つけていない機能をときどき案内します。閉じたヒントは二度と表示されません。役に立つときは Hermes からも案内できます。',+ 'アプリが待機中のとき、まだ見つけていない機能をときどき案内します。閉じたヒントは二度と表示されません。',tipsReset: (count: number) => `閉じた${count}件のヒントを元に戻す`,composerPopoutTitle: 'フローティング入力欄',composerPopoutDesc: '入力欄をドックからドラッグして外せるようにします。オフにすると画面下部に固定されます。',diff --git a/apps/desktop/src/i18n/zh-hant.ts b/apps/desktop/src/i18n/zh-hant.tsindex 15253340c22..2f2198c5bc2 100644--- a/apps/desktop/src/i18n/zh-hant.ts+++ b/apps/desktop/src/i18n/zh-hant.ts@@ -401,7 +401,7 @@ export const zhHant = defineLocale({reactionsTitle: '訊息回應',reactionsDesc: 'iMessage 風格的表情回應 — 你可以對訊息做出回應,Hermes 也能回應你的訊息。',tipsTitle: '應用程式內提示',- tipsDesc: '偶爾指出你可能還沒發現的功能。關掉一則就不再出現;需要時 Hermes 也能指給你看。',+ tipsDesc: '應用程式閒置時,偶爾指出你可能還沒發現的功能。關掉一則就不再出現。',tipsReset: (count: number) => `復原 ${count} 則已關閉的提示`,composerPopoutTitle: '懸浮輸入框',composerPopoutDesc: '允許將輸入框拖出底部停靠區。關閉後,輸入框會鎖定在底部。',diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.tsindex 2928974c40c..6dd0481c375 100644--- a/apps/desktop/src/i18n/zh.ts+++ b/apps/desktop/src/i18n/zh.ts@@ -575,7 +575,7 @@ export const zh: Translations = {reactionsTitle: '消息回应',reactionsDesc: 'iMessage 风格的表情回应 — 你可以给消息添加回应,Hermes 也能回应你的消息。',tipsTitle: '应用内提示',- tipsDesc: '偶尔指出你可能还没发现的功能。关掉一条就不再出现;需要时 Hermes 也能指给你看。',+ tipsDesc: '应用空闲时,偶尔指出你可能还没发现的功能。关掉一条就不再出现。',tipsReset: (count: number) => `恢复 ${count} 条已关闭的提示`,composerPopoutTitle: '悬浮输入框',composerPopoutDesc: '允许将输入框拖出底部停靠区。关闭后,输入框会锁定在底部。',diff --git a/apps/desktop/src/store/tips.ts b/apps/desktop/src/store/tips.tsindex 6e023b42e93..d9fe6f07237 100644--- a/apps/desktop/src/store/tips.ts+++ b/apps/desktop/src/store/tips.ts@@ -1,14 +1,19 @@/**- * In-app tips — on by default, closable for good.+ * In-app tips — the app pointing at itself, plus the agent doing the same.*- * Three pieces of state, three different lifetimes:+ * Two sources, one bubble, and only one of them is behind a switch:*- * - `$tipsEnabled` is the opt-OUT. Persisted, and mirrored into- * `display.in_app_tips` on the CONNECTED gateway so the agent's `tip` tool- * answers to the same switch the user flipped — one lever, not two.- * - `$retiredTips` is the hard-close ledger. A tip the user ✕'d never comes- * back on its own; Settings → Reset is the only way, and that is the whole- * contract behind the ✕ being a heavier gesture than closing the bubble.+ * - `$tipRotationEnabled` is the ambient rotation, OFF until asked for. The app+ * volunteering commentary at idle is a taste, not a default, and a feature+ * that talks unprompted has to be opted into rather than discovered and then+ * switched off.+ * - An agent tip is not ambient. Hermes raises one mid-sentence, in a+ * conversation the user is having, exactly as it raises a `tour` — so it+ * answers to the same nothing a tour answers to.+ * - `$retiredTips` is the hard-close ledger for the rotation. A tip the user ✕'d+ * never comes back on its own; Settings → Reset is the only way, and that is+ * the whole contract behind the ✕ being a heavier gesture than letting the+ * bubble time out.* - `$activeTip` is what is on screen. Ephemeral by design: a tip is a nicety,* and one that survives a reload has overstayed.*@@ -21,7 +26,6 @@ import { atom } from 'nanostores'import { Codecs, persistentAtom } from '@/lib/persisted'import type { TipSide } from '@/lib/tips/catalog'-import { activeGateway } from '@/store/gateway'/** A tip as the bubble needs it: resolved copy, resolved anchor. */export interface ActiveTip {@@ -37,18 +41,19 @@ export interface ActiveTip {title?: string}-// Opt-out: absent storage means on.-export const $tipsEnabled = persistentAtom('hermes.desktop.tips.v1', true, Codecs.bool)+export const $tipRotationEnabled = persistentAtom('hermes.desktop.tips.rotation.v1', false, Codecs.bool)export const $retiredTips = persistentAtom<string[]>('hermes.desktop.tips.retired.v1', [], Codecs.stringArray)export const $lastTipId = persistentAtom<null | string>('hermes.desktop.tips.last.v1', null, Codecs.nullableText)export const $activeTip = atom<ActiveTip | null>(null)-export function setTipsEnabled(enabled: boolean): void {+export function setTipRotationEnabled(enabled: boolean): void {if (!enabled) {+ // Including whichever one is up: the switch is answering a bubble on+ // screen as often as it is answering the idea of them.$activeTip.set(null)}- $tipsEnabled.set(enabled)+ $tipRotationEnabled.set(enabled)}/** Un-retire everything. The rotation starts over from a full deck. */@@ -56,21 +61,13 @@ export function resetTips(): void {$retiredTips.set([])}-/** Put a tip on screen. A no-op while tips are off — every caller, agent- * included, goes through here so the opt-out has exactly one enforcement- * point. */-export function showTip(tip: ActiveTip): boolean {- if (!$tipsEnabled.get()) {- return false- }-+/** Put a tip on screen, replacing whatever was there. */+export function showTip(tip: ActiveTip): void {if (tip.tipId) {$lastTipId.set(tip.tipId)}$activeTip.set(tip)-- return true}/** Soft close: this one has had its moment, the rotation carries on. */@@ -89,16 +86,3 @@ export function retireActiveTip(): void {$activeTip.set(null)}--// The agent's `tip` tool gates on this key, and reading it off the CONNECTED-// gateway is what makes the toggle work the same whether that gateway is local,-// SSH, URL, or cloud. listen(), not subscribe(): boot must not write back the-// value it just read.-$tipsEnabled.listen(enabled => {- void activeGateway()- ?.request('config.set', { key: 'display.in_app_tips', value: String(enabled) })- .catch(() => {- // Not connected yet — the next toggle still lands, and absent config- // reads as on, which matches the renderer's own default.- })-})diff --git a/tests/tools/test_tip_tool.py b/tests/tools/test_tip_tool.pyindex eacc0721f2f..a510f0c0a46 100644--- a/tests/tools/test_tip_tool.py+++ b/tests/tools/test_tip_tool.py@@ -30,6 +30,14 @@ def test_lives_in_the_gui_surface_toolset(monkeypatch):assert entry.toolset == "desktop_ui"+def test_is_ungated_like_tour():+ """The Appearance switch governs the app's idle rotation, not this."""+ entry = registry.get_entry("tip")++ assert entry is not None+ assert entry.check_fn is None++def test_requires_the_desktop_bridge(monkeypatch):"""Outside the desktop GUI there is no emitter — a clear error, no crash."""monkeypatch.setattr(tt.desktop_ui, "emit", lambda _event, _payload: False)@@ -77,38 +85,3 @@ def test_bridge_failure_is_reported(monkeypatch):monkeypatch.setattr(tt.desktop_ui, "emit", _boom)assert "renderer went away" in json.loads(tt.tip_tool(text="Hi", selector="#a"))["error"]---class TestOptOut:- """The user's switch gates the tool, and an absent key reads as ON."""-- def _with_display(self, monkeypatch, display):- import hermes_cli.config as config_mod-- monkeypatch.setattr(config_mod, "load_config_readonly", lambda: {"display": display})-- def test_available_by_default(self, monkeypatch):- self._with_display(monkeypatch, {})-- assert tt.check_tips_enabled() is True-- def test_withdrawn_when_the_user_opts_out(self, monkeypatch):- self._with_display(monkeypatch, {"in_app_tips": False})-- assert tt.check_tips_enabled() is False-- def test_unreadable_config_leaves_the_tool_available(self, monkeypatch):- import hermes_cli.config as config_mod-- def _boom():- raise OSError("no config here")-- monkeypatch.setattr(config_mod, "load_config_readonly", _boom)-- assert tt.check_tips_enabled() is True-- def test_the_switch_is_what_gates_registration(self):- entry = registry.get_entry("tip")-- assert entry is not None- assert entry.check_fn is tt.check_tips_enableddiff --git a/tools/tip_tool.py b/tools/tip_tool.pyindex eaf9396d251..2b2e6807ed3 100644--- a/tools/tip_tool.py+++ b/tools/tip_tool.py@@ -8,9 +8,11 @@ about, which is the right weight for "that button, there" in the middle of asentence.Fire-and-forget, unlike ``tour``: a tip is not a question, so blocking the turn-on a round-trip would stall the reply it belongs to. The renderer enforces the-user's Settings → Appearance → In-App Tips switch as well, so a stale config-read here can never put a bubble on a screen that asked for none.+on a round-trip would stall the reply it belongs to.++Ungated, also like ``tour``. The desktop's Settings → Appearance switch governs+the app's own idle rotation — the half that talks unprompted — not this, which+Hermes raises mid-conversation in answer to something the user said.Lives in the ``desktop_ui`` toolset, which the GUI gateway enables only fordesktop-sourced sessions.@@ -57,26 +59,6 @@ def tip_tool(text: str, selector: str, title: str = "", side: str = "") -> str:return json.dumps({"success": True, "selector": selector}, ensure_ascii=False)-def check_tips_enabled() -> bool:- """The user's own switch (Settings → Appearance → In-App Tips).-- Opt-OUT, so an absent key reads as ON — that matches the desktop's own- default, and the renderer only writes the key when the user changes it. The- desktop mirrors the toggle into ``display.in_app_tips`` on the CONNECTED- gateway's config, so this reads the right value whether that gateway is- local, SSH, URL, or cloud.- """- try:- from hermes_cli.config import load_config_readonly-- display = load_config_readonly().get("display")- except Exception:- return True- if not isinstance(display, dict):- return True- return bool(display.get("in_app_tips", True))--TIP_SCHEMA = {"name": "tip","description": (@@ -87,9 +69,8 @@ TIP_SCHEMA = {"Call tour(action='targets') first to see what's on screen and prefer ""a target reporting `stable: true`; never guess a selector. One tip at ""a time — a new one replaces the last. Say the same thing in chat as "- "well; the bubble is a pointer, not the message. Use it sparingly: the "- "app shows its own tips on a slow rotation, and a bubble on every turn "- "is what makes people turn the feature off."+ "well; the bubble is a pointer, not the message. Use it sparingly: a "+ "bubble on every turn is what makes people stop reading them."),"parameters": {"type": "object",@@ -130,6 +111,5 @@ registry.register(title=args.get("title", ""),side=args.get("side", ""),),- check_fn=check_tips_enabled,emoji="💡",)diff --git a/website/docs/reference/tools-reference.md b/website/docs/reference/tools-reference.mdindex 7edc7342ece..24943617615 100644--- a/website/docs/reference/tools-reference.md+++ b/website/docs/reference/tools-reference.md@@ -205,7 +205,7 @@ messaging, and cron sessions.| `focus_pane` | Reveal and focus a pane in the Hermes desktop app (chat, files, terminal, review, sessions). | — || `react_to_message` | React to a message with a single emoji, iMessage-tapback style. Opt-in via Settings → Appearance (`display.message_reactions`). | — || `tour` | Give a live guided tour: dim the screen, highlight an element, and attach a narrated popover (driver.js). Works on the Hermes app's own UI and on any page open in the preview pane; `targets` discovers what's on screen, `show` narrates step-by-step, `start` hands the user Next/Prev controls. | — |-| `tip` | Point at one element with a small accent bubble and an arrow — the quiet sibling of `tour`, with no dimming, no spotlight, and no Next/Prev. Same `data-tour` handles and the same `tour(action='targets')` discovery call. Opt-out via Settings → Appearance (`display.in_app_tips`). | — |+| `tip` | Point at one element with a small accent bubble and an arrow — the quiet sibling of `tour`, with no dimming, no spotlight, and no Next/Prev. Same `data-tour` handles and the same `tour(action='targets')` discovery call. | — |### Tours@@ -264,10 +264,12 @@ The `tip` tool takes the same selectors `tour(action='targets')` reports, sodiscovery is one call for both, and the durable `data-tour` handles above nametargets for either. One tip is on screen at a time; a new one replaces the last.-The app also shows its own tips, walking a built-in catalog of app features on a-slow rotation whenever things are quiet. Closing one with its ✕ retires that tip-for good (Settings → Appearance → Reset brings them back), and the same-Appearance switch turns the whole feature — rotation and tool alike — off.+The app can also show its own, walking a built-in catalog of app features on a+slow rotation whenever things are quiet. That half is off until switched on in+Settings → Appearance, since it talks unprompted; closing one of its tips with+the ✕ retires that tip for good, and the same settings row brings them back. The+tool is not behind that switch — like `tour`, it runs in answer to the+conversation rather than at idle.## `todo` toolset