The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
feat(shared-metrics): offer two consent answers, drop collect-only
emozillad7c48548a972
diff --git a/apps/desktop/src/app/settings/shared-metrics-settings.test.tsx b/apps/desktop/src/app/settings/shared-metrics-settings.test.tsxnew file mode 100644index 00000000000..6be4d7ea2b0--- /dev/null+++ b/apps/desktop/src/app/settings/shared-metrics-settings.test.tsx@@ -0,0 +1,79 @@+// @vitest-environment jsdom+import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'+import { afterEach, describe, expect, it, vi } from 'vitest'++import type * as GatewayStore from '@/store/gateway'+import type { SharedMetricsConsent } from '@/store/shared-metrics'++const requestGatewayForAgent = vi.fn()++// The real gateway store, with only the per-agent request routed to the fake backend below.+vi.mock('@/store/gateway', async importOriginal => ({+ ...(await importOriginal<typeof GatewayStore>()),+ requestGatewayForAgent: (...args: unknown[]) => requestGatewayForAgent(...args)+}))+vi.mock('@/store/desktop-metrics', () => ({ recordOnboarding: vi.fn(), setDesktopMetricsGate: vi.fn() }))++const { en } = await import('@/i18n/en')+const { SharedMetricsSettings } = await import('./shared-metrics-settings')++const copy = en.sharedMetrics++function backend(initial: SharedMetricsConsent) {+ let stored = initial++ requestGatewayForAgent.mockImplementation(+ async (_connection: unknown, _profile: unknown, method: string, params: Record<string, unknown> = {}) => {+ if (method === 'shared_metrics.set') {+ const enabled = params.enabled === true+ stored = { enabled, send: enabled && params.send === true, decided: true }+ }++ return stored+ }+ )+}++const setCalls = () =>+ requestGatewayForAgent.mock.calls+ .filter(call => call[2] === 'shared_metrics.set')+ .map(call => ({ enabled: call[3].enabled, send: call[3].send }))++afterEach(() => {+ cleanup()+ requestGatewayForAgent.mockReset()+})++describe('SharedMetricsSettings', () => {+ it('is one switch: on shares (both opt-ins), off clears both', async () => {+ backend({ enabled: false, send: false, decided: true })++ render(<SharedMetricsSettings />)++ const share = await screen.findByRole('switch', { name: copy.sendLabel })+ await waitFor(() => expect(share.hasAttribute('disabled')).toBe(false))+ expect(screen.getAllByRole('switch')).toHaveLength(1)+ expect(share.getAttribute('aria-checked')).toBe('false')++ fireEvent.click(share)+ await waitFor(() => expect(share.getAttribute('aria-checked')).toBe('true'))++ fireEvent.click(share)+ await waitFor(() => expect(share.getAttribute('aria-checked')).toBe('false'))++ expect(setCalls()).toEqual([+ { enabled: true, send: true },+ { enabled: false, send: false }+ ])+ })++ it('reads a retired collect-only answer as not sharing', async () => {+ backend({ enabled: true, send: false, decided: true })++ render(<SharedMetricsSettings />)++ const share = await screen.findByRole('switch', { name: copy.sendLabel })+ await waitFor(() => expect(share.hasAttribute('disabled')).toBe(false))+ expect(share.getAttribute('aria-checked')).toBe('false')+ })+})diff --git a/apps/desktop/src/app/settings/shared-metrics-settings.tsx b/apps/desktop/src/app/settings/shared-metrics-settings.tsxindex 4b37c729c27..7ad265ecde5 100644--- a/apps/desktop/src/app/settings/shared-metrics-settings.tsx+++ b/apps/desktop/src/app/settings/shared-metrics-settings.tsx@@ -20,10 +20,11 @@ import {import { ToggleRow } from './primitives'/**- * Settings › Safety › Privacy: the same two opt-ins the first-run dialog and- * `hermes setup` write, for the profile this page applies to. Collection off- * turns sending off with it (the backend enforces it too), so the send switch- * is disabled until collection is on. Optimistic, rolled back on failure.+ * Settings › Safety › Privacy: one switch for the answer the first-run offer and+ * `hermes setup` write, for the profile this page applies to. On sets both+ * opt-ins (collect and send), off clears both. A collect-only answer from+ * before the offer dropped it reads off here: nothing is shared. Optimistic,+ * rolled back on failure.*/export function SharedMetricsSettings() {const { t } = useI18n()@@ -87,28 +88,20 @@ export function SharedMetricsSettings() {}}- // An older backend has no shared_metrics.* methods: keep the controls, disabled and explained.+ // An older backend has no shared_metrics.* methods: keep the control, disabled and explained.const unavailable = loaded && consent === null- const enabled = consent?.enabled ?? false- const send = consent?.send ?? false+ const sharing = consent?.send ?? falsereturn (<div className="grid gap-1" id="setting-shared-metrics">- <ToggleRow- checked={enabled}- description={copy.collectDesc}- disabled={!consent || busy}- hint={unavailable ? copy.unavailable : undefined}- label={copy.collectLabel}- onChange={on => void save({ enabled: on, send: on && send })}- /><ToggleRowbelow={<DocsLink href={SHARED_METRICS_DOCS_URL}>{copy.whatIsCollected}</DocsLink>}- checked={send}+ checked={sharing}description={copy.sendDesc}- disabled={!consent || busy || !enabled}+ disabled={!consent || busy}+ hint={unavailable ? copy.unavailable : undefined}label={copy.sendLabel}- onChange={on => void save({ enabled, send: on })}+ onChange={on => void save({ enabled: on, send: on })}/></div>)diff --git a/apps/desktop/src/components/shared-metrics/consent-dialog.test.tsx b/apps/desktop/src/components/shared-metrics/consent-dialog.test.tsxindex bee7669e932..da0434680c0 100644--- a/apps/desktop/src/components/shared-metrics/consent-dialog.test.tsx+++ b/apps/desktop/src/components/shared-metrics/consent-dialog.test.tsx@@ -83,15 +83,17 @@ describe('SharedMetricsConsentDialog', () => {expect(sharedMetricsOfferPending($sharedMetricsConsent.get())).toBe(true)$sharedMetricsDetailsOpen.set(true)- const keepLocal = await screen.findByRole('button', { name: copy.local })+ const noThanks = await screen.findByRole('button', { name: copy.off })+ expect(screen.getByRole('button', { name: copy.share })).toBeTruthy()+ expect(screen.queryByRole('button', { name: /computer|local/i })).toBeNull()// Nothing is preselected: no choice holds focus when the details open.- expect(keepLocal.ownerDocument.activeElement).not.toBe(keepLocal)- fireEvent.click(keepLocal)+ expect(noThanks.ownerDocument.activeElement).not.toBe(noThanks)+ fireEvent.click(noThanks)await waitFor(() => expect(sharedMetricsOfferPending($sharedMetricsConsent.get())).toBe(false))expect(screen.queryByRole('dialog')).toBeNull()expect(calls.find(c => c.method === 'shared_metrics.set')?.params).toEqual({- enabled: true,+ enabled: false,send: false,first_run: true,profile: 'havoc'diff --git a/apps/desktop/src/components/shared-metrics/consent-dialog.tsx b/apps/desktop/src/components/shared-metrics/consent-dialog.tsxindex 6c0f98f599d..bfb10d244ff 100644--- a/apps/desktop/src/components/shared-metrics/consent-dialog.tsx+++ b/apps/desktop/src/components/shared-metrics/consent-dialog.tsx@@ -38,7 +38,7 @@ interface SharedMetricsConsentDialogProps {requestGateway: SharedMetricsRequester}-const CHOICE_ORDER: readonly SharedMetricsChoice[] = ['share', 'local', 'off']+const CHOICE_ORDER: readonly SharedMetricsChoice[] = ['share', 'off']/*** Owner of the one-time shared-metrics question, the Desktop twin of `hermes@@ -48,7 +48,7 @@ const CHOICE_ORDER: readonly SharedMetricsChoice[] = ['share', 'local', 'off']* healthy install opens straight to chat. An answer given in the CLI (or here,* or in Settings) is the same config keys, so nobody is asked twice. This host* also paints the "What is collected" details the strip opens on request:- * three equal choices, none preselected or focused, and closing it decides+ * two equal choices, neither preselected or focused, and closing it decides* nothing (the strip stays until answered).*/export function SharedMetricsConsentDialog({ enabled, profile, requestGateway }: SharedMetricsConsentDialogProps) {diff --git a/apps/desktop/src/components/shared-metrics/consent-strip.test.tsx b/apps/desktop/src/components/shared-metrics/consent-strip.test.tsxindex 7c9dd778d71..bfda0df820d 100644--- a/apps/desktop/src/components/shared-metrics/consent-strip.test.tsx+++ b/apps/desktop/src/components/shared-metrics/consent-strip.test.tsx@@ -42,17 +42,24 @@ afterEach(() => {})describe('SharedMetricsConsentStrip', () => {- it('records the chosen answer on the focused profile', async () => {+ it('offers two answers, and sharing sets both opt-ins on the focused profile', async () => {installGatewayMock({ enabled: false, send: false, decided: false })render(<SharedMetricsConsentStrip />)- fireEvent.click(screen.getByRole('button', { name: copy.stripChoices.local }))+ expect(screen.getAllByRole('button').map(button => button.textContent)).toEqual([+ copy.stripChoices.share,+ copy.stripChoices.off,+ copy.stripDetails+ ])+ expect(screen.getByText(copy.stripBody)).toBeTruthy()++ fireEvent.click(screen.getByRole('button', { name: copy.stripChoices.share }))await waitFor(() =>expect(requestGateway).toHaveBeenCalledWith('shared_metrics.set', {enabled: true,- send: false,+ send: true,first_run: true,profile: 'havoc'})diff --git a/apps/desktop/src/components/shared-metrics/consent-strip.tsx b/apps/desktop/src/components/shared-metrics/consent-strip.tsxindex 150b49429c0..56393be457f 100644--- a/apps/desktop/src/components/shared-metrics/consent-strip.tsx+++ b/apps/desktop/src/components/shared-metrics/consent-strip.tsx@@ -16,12 +16,12 @@ import {sharedMetricsProfileRequester} from '@/store/shared-metrics'-const CHOICES: readonly SharedMetricsChoice[] = ['share', 'local', 'off']+const CHOICES: readonly SharedMetricsChoice[] = ['share', 'off']/*** The first-run shared-metrics offer, in the composer status stack beside the* free-tier strip: it never blocks the composer or takes focus, and it stays- * until one of the three equal answers is saved (the backend's `decided` is+ * until one of the two equal answers is saved (the backend's `decided` is* the only latch). "Details" opens the full explainer the host paints.*/export function SharedMetricsConsentStrip() {diff --git a/apps/desktop/src/i18n/ar_common.ts b/apps/desktop/src/i18n/ar_common.tsindex 5a82297e1fb..1cbaa3abca6 100644--- a/apps/desktop/src/i18n/ar_common.ts+++ b/apps/desktop/src/i18n/ar_common.ts@@ -15,21 +15,18 @@ export const arCommon = {collectedUsage: 'جودة الوكيل: التعديلات الفاشلة، واستدعاءات الأدوات المعطوبة، والحلقات العالقة، والتكلفة لكل مهمة',collectedMachine: 'الجهاز: نظام التشغيل، ونطاق الذاكرة، ونوع وحدة الرسوميات، وإصدار Hermes، واستخدام نموذج محلي',sending:- 'تبقى الإحصاءات على هذا الجهاز ما لم تختر المشاركة. تُرسل الإحصاءات المشتركة إلى Nous مرة يوميًا مع معرّف عشوائي لهذا الملف الشخصي. باستثناء ملاحظة لمرة واحدة بأن Hermes قد ثُبّت، ولا تُحتسب إلا بعد موافقتك، لا تُرسل أبدًا الإحصاءات السابقة لموافقتك. يمكنك تغيير ذلك في أي وقت من الإعدادات.',+ 'إذا اخترت المشاركة، يرسل Hermes الإحصاءات إلى Nous مرة يوميًا مع معرّف عشوائي لهذا الملف الشخصي. باستثناء ملاحظة لمرة واحدة بأن Hermes قد ثُبّت، لا تُرسل أبدًا الإحصاءات السابقة لموافقتك. يمكنك تغيير ذلك في أي وقت من الإعدادات.',readDocs: 'اقرأ التفاصيل الكاملة',share: 'المشاركة مع Nous',- local: 'الإبقاء على هذا الجهاز',off: 'لا، شكرًا',saveFailed: 'تعذّر حفظ اختيارك',- collectLabel: 'جمع إحصاءات الاستخدام',- collectDesc: 'إحصاءات فقط، تُحفظ على هذا الجهاز. لا تشمل أبدًا رسائلك أو ملفاتك أو مساراتك أو نصوص الأخطاء.',sendLabel: 'مشاركة إحصاءات الاستخدام مع Nous',sendDesc:- 'يرسل الإحصاءات إلى Nous مرة يوميًا مع معرّف عشوائي لهذا الملف الشخصي. باستثناء ملاحظة التثبيت لمرة واحدة، لا تُرسل أبدًا الإحصاءات السابقة لموافقتك. يتطلب تفعيل الجمع.',+ 'إحصاءات فقط، تُرسل مرة يوميًا مع معرّف عشوائي لهذا الملف الشخصي. لا تشمل أبدًا رسائلك أو ملفاتك أو مساراتك أو نصوص الأخطاء.',unavailable: 'حدّث واجهة Hermes الخلفية لتغيير هذا الإعداد.',stripBody: 'إحصاءات فقط. لا تشمل أبدًا رسائلك أو ملفاتك.',stripReaskBody: 'نسألك مرة أخرى: ربما حفظ إصدار سابق «لا، شكرًا» قبل أن ترى هذا السؤال.',- stripChoices: { share: 'المشاركة مع Nous', local: 'الإبقاء على هذا الجهاز', off: 'لا، شكرًا' },+ stripChoices: { share: 'المشاركة مع Nous', off: 'لا، شكرًا' },stripDetails: 'التفاصيل'},common: {diff --git a/apps/desktop/src/i18n/de_shared_metrics.ts b/apps/desktop/src/i18n/de_shared_metrics.tsindex b1e8ffd8825..c3435cde034 100644--- a/apps/desktop/src/i18n/de_shared_metrics.ts+++ b/apps/desktop/src/i18n/de_shared_metrics.ts@@ -15,22 +15,18 @@ export const deSharedMetrics = {'Agentenqualität: verfehlte Bearbeitungen, fehlerhafte Tool-Aufrufe, festgefahrene Schleifen, Kosten pro Aufgabe',collectedMachine: 'Gerät: Betriebssystem, RAM-Bereich, GPU-Typ, Hermes-Version, Nutzung lokaler Modelle',sending:- 'Statistiken bleiben auf diesem Computer, sofern Sie nicht „Teilen“ wählen. Geteilte Statistiken gehen einmal täglich mit einer zufälligen ID für dieses Profil an Nous. Abgesehen von einem einmaligen Hinweis, dass Hermes installiert wurde (erst nach Ihrer Zustimmung gezählt), werden Statistiken von vor Ihrer Zustimmung nie gesendet. Sie können das jederzeit in den Einstellungen ändern.',+ 'Wenn Sie teilen, sendet Hermes Statistiken einmal täglich mit einer zufälligen ID für dieses Profil an Nous. Abgesehen von einem einmaligen Hinweis, dass Hermes installiert wurde, werden Statistiken von vor Ihrer Zustimmung nie gesendet. Sie können das jederzeit in den Einstellungen ändern.',readDocs: 'Alle Details lesen',share: 'Mit Nous teilen',- local: 'Auf diesem Computer behalten',off: 'Nein, danke',saveFailed: 'Ihre Auswahl konnte nicht gespeichert werden',- collectLabel: 'Nutzungsstatistiken erfassen',- collectDesc:- 'Nur Zählwerte, auf diesem Computer gespeichert. Niemals Ihre Nachrichten, Dateien, Pfade oder Fehlertexte.',sendLabel: 'Nutzungsstatistiken mit Nous teilen',sendDesc:- 'Sendet Statistiken einmal täglich mit einer zufälligen ID für dieses Profil an Nous. Abgesehen vom einmaligen Installationshinweis werden Statistiken von vor Ihrer Zustimmung nie gesendet. Erfordert aktive Erfassung.',+ 'Nur Zählwerte, einmal täglich mit einer zufälligen ID für dieses Profil gesendet. Niemals Ihre Nachrichten, Dateien, Pfade oder Fehlertexte.',unavailable: 'Aktualisieren Sie das Hermes-Backend, um diese Einstellung zu ändern.',stripBody: 'Nur Zählwerte. Niemals Ihre Nachrichten oder Dateien.',stripReaskBody:'Wir fragen noch einmal: Eine frühere Version konnte „Nein danke“ speichern, bevor Sie diese Frage gesehen haben.',- stripChoices: { share: 'Mit Nous teilen', local: 'Auf diesem Computer behalten', off: 'Nein danke' },+ stripChoices: { share: 'Mit Nous teilen', off: 'Nein danke' },stripDetails: 'Details'}diff --git a/apps/desktop/src/i18n/en_shared_metrics.ts b/apps/desktop/src/i18n/en_shared_metrics.tsindex a525459ec72..1673c7e9477 100644--- a/apps/desktop/src/i18n/en_shared_metrics.ts+++ b/apps/desktop/src/i18n/en_shared_metrics.ts@@ -14,20 +14,17 @@ export const enSharedMetrics: Translations['sharedMetrics'] = {collectedUsage: 'Agent quality: missed edits, broken tool calls, stuck loops, cost per task',collectedMachine: 'Machine: OS, RAM range, GPU type, Hermes version, local model use',sending:- 'Stats stay on this computer unless you choose Share. Shared stats go to Nous once a day with a random ID for this profile. Apart from a one-time note that Hermes was installed, counted only once you opt in, stats from before you opted in are never sent. Change this anytime in Settings.',+ 'If you share, Hermes sends stats to Nous once a day with a random ID for this profile. Apart from a one-time note that Hermes was installed, stats from before you opt in are never sent. Change this anytime in Settings.',readDocs: 'Read the full details',share: 'Share with Nous',- local: 'Keep on this computer',off: 'No thanks',saveFailed: 'Couldn’t save your choice',- collectLabel: 'Collect usage stats',- collectDesc: 'Counts only, kept on this computer. Never your messages, files, paths or error text.',sendLabel: 'Share usage stats with Nous',sendDesc:- 'Sends stats to Nous once a day with a random ID for this profile. Apart from the one-time install note, stats from before you opted in are never sent. Needs collection on.',+ 'Counts only, sent once a day with a random ID for this profile. Never your messages, files, paths or error text.',unavailable: 'Update the Hermes backend to change this setting.',stripBody: 'Counts only. Never your messages or files.',stripReaskBody: 'Asking once more: an earlier version could save “No thanks” before you saw this.',- stripChoices: { share: 'Share with Nous', local: 'Keep on this computer', off: 'No thanks' },+ stripChoices: { share: 'Share with Nous', off: 'No thanks' },stripDetails: 'Details'}diff --git a/apps/desktop/src/i18n/es_shared_metrics.ts b/apps/desktop/src/i18n/es_shared_metrics.tsindex cc46b09f6c5..c8afe981f6d 100644--- a/apps/desktop/src/i18n/es_shared_metrics.ts+++ b/apps/desktop/src/i18n/es_shared_metrics.ts@@ -15,21 +15,18 @@ export const esSharedMetrics = {'Calidad del agente: ediciones fallidas, llamadas a herramientas rotas, bucles atascados, coste por tarea',collectedMachine: 'Equipo: sistema operativo, rango de RAM, tipo de GPU, versión de Hermes, uso de modelos locales',sending:- 'Las estadísticas se quedan en este equipo a menos que elijas Compartir. Las estadísticas compartidas se envían a Nous una vez al día con un ID aleatorio para este perfil. Salvo un aviso único de que Hermes se instaló, que solo se cuenta cuando aceptas, las estadísticas de antes de aceptar nunca se envían. Puedes cambiarlo cuando quieras en Configuración.',+ 'Si compartes, Hermes envía las estadísticas a Nous una vez al día con un ID aleatorio para este perfil. Salvo un aviso único de que Hermes se instaló, las estadísticas de antes de aceptar nunca se envían. Puedes cambiarlo cuando quieras en Configuración.',readDocs: 'Leer todos los detalles',share: 'Compartir con Nous',- local: 'Guardar en este equipo',off: 'No, gracias',saveFailed: 'No se pudo guardar tu elección',- collectLabel: 'Recopilar estadísticas de uso',- collectDesc: 'Solo recuentos, guardados en este equipo. Nunca tus mensajes, archivos, rutas ni textos de error.',sendLabel: 'Compartir estadísticas de uso con Nous',sendDesc:- 'Envía las estadísticas a Nous una vez al día con un ID aleatorio para este perfil. Salvo el aviso único de instalación, nunca se envían estadísticas de antes de que aceptaras. Requiere la recopilación activada.',+ 'Solo recuentos, enviados una vez al día con un ID aleatorio para este perfil. Nunca tus mensajes, archivos, rutas ni textos de error.',unavailable: 'Actualiza el backend de Hermes para cambiar este ajuste.',stripBody: 'Solo recuentos. Nunca tus mensajes ni archivos.',stripReaskBody:'Te lo preguntamos de nuevo: una versión anterior podía guardar «No, gracias» antes de que vieras esta pregunta.',- stripChoices: { share: 'Compartir con Nous', local: 'Guardar en este equipo', off: 'No, gracias' },+ stripChoices: { share: 'Compartir con Nous', off: 'No, gracias' },stripDetails: 'Detalles'}diff --git a/apps/desktop/src/i18n/fr_shared_metrics.ts b/apps/desktop/src/i18n/fr_shared_metrics.tsindex 1fddc926656..7a3446b4f14 100644--- a/apps/desktop/src/i18n/fr_shared_metrics.ts+++ b/apps/desktop/src/i18n/fr_shared_metrics.ts@@ -16,22 +16,18 @@ export const frSharedMetrics = {collectedMachine:'Machine : système d’exploitation, plage de RAM, type de GPU, version de Hermes, utilisation de modèles locaux',sending:- 'Les statistiques restent sur cet ordinateur sauf si vous choisissez Partager. Les statistiques partagées sont envoyées à Nous une fois par jour avec un identifiant aléatoire propre à ce profil. Hormis une note unique indiquant que Hermes a été installé, comptée seulement après votre accord, les statistiques d’avant votre accord ne sont jamais envoyées. Modifiez ce choix à tout moment dans les Paramètres.',+ 'Si vous partagez, Hermes envoie les statistiques à Nous une fois par jour avec un identifiant aléatoire propre à ce profil. Hormis une note unique indiquant que Hermes a été installé, les statistiques d’avant votre accord ne sont jamais envoyées. Modifiez ce choix à tout moment dans les Paramètres.',readDocs: 'Lire tous les détails',share: 'Partager avec Nous',- local: 'Garder sur cet ordinateur',off: 'Non merci',saveFailed: 'Impossible d’enregistrer votre choix',- collectLabel: 'Collecter les statistiques d’utilisation',- collectDesc:- 'Uniquement des comptages, conservés sur cet ordinateur. Jamais vos messages, fichiers, chemins ni textes d’erreur.',sendLabel: 'Partager les statistiques d’utilisation avec Nous',sendDesc:- 'Envoie les statistiques à Nous une fois par jour avec un identifiant aléatoire pour ce profil. Hormis la note unique d’installation, les statistiques d’avant votre accord ne sont jamais envoyées. Nécessite la collecte activée.',+ 'Uniquement des comptages, envoyés une fois par jour avec un identifiant aléatoire pour ce profil. Jamais vos messages, fichiers, chemins ni textes d’erreur.',unavailable: 'Mettez à jour le backend Hermes pour modifier ce réglage.',stripBody: 'Uniquement des comptages. Jamais vos messages ni vos fichiers.',stripReaskBody:'Nouvelle demande : une version précédente pouvait enregistrer « Non merci » avant que vous ne voyiez cette question.',- stripChoices: { share: 'Partager avec Nous', local: 'Garder sur cet ordinateur', off: 'Non merci' },+ stripChoices: { share: 'Partager avec Nous', off: 'Non merci' },stripDetails: 'Détails'}diff --git a/apps/desktop/src/i18n/ja_shared_metrics.ts b/apps/desktop/src/i18n/ja_shared_metrics.tsindex 93288e79a27..c86f049ae5a 100644--- a/apps/desktop/src/i18n/ja_shared_metrics.ts+++ b/apps/desktop/src/i18n/ja_shared_metrics.ts@@ -12,21 +12,18 @@ export const jaSharedMetrics = {collectedUsage: 'エージェントの品質:失敗した編集、壊れたツール呼び出し、抜け出せないループ、タスクごとのコスト',collectedMachine: 'マシン:OS、RAM の範囲、GPU の種類、Hermes のバージョン、ローカルモデルの使用',sending:- '「共有」を選ばない限り、統計はこのコンピューターに保存されます。共有した統計は、このプロファイル用のランダムな ID とともに 1 日 1 回 Nous に送信されます。Hermes がインストールされたことを示す 1 回限りの記録(オプトイン後にのみ集計)を除き、オプトイン前の統計が送信されることはありません。この設定はいつでも設定画面で変更できます。',+ '共有すると、Hermes はこのプロファイル用のランダムな ID とともに 1 日 1 回 Nous に統計を送信します。Hermes がインストールされたことを示す 1 回限りの記録を除き、オプトイン前の統計が送信されることはありません。この設定はいつでも設定画面で変更できます。',readDocs: '詳細を読む',share: 'Nous と共有する',- local: 'このコンピューターに保存する',off: '共有しない',saveFailed: '選択を保存できませんでした',- collectLabel: '利用統計を収集する',- collectDesc: '件数のみをこのコンピューターに保存します。メッセージ、ファイル、パス、エラーテキストは一切含みません。',sendLabel: '利用統計を Nous と共有する',sendDesc:- 'このプロファイル用のランダムな ID を付けて、1 日 1 回 Nous に統計を送信します。1 回限りのインストール記録を除き、オプトイン前の統計は送信されません。収集がオンである必要があります。',+ '件数のみを、このプロファイル用のランダムな ID を付けて 1 日 1 回送信します。メッセージ、ファイル、パス、エラーテキストは一切含みません。',unavailable: 'この設定を変更するには Hermes バックエンドを更新してください。',stripBody: '件数のみ。メッセージやファイルは一切含みません。',stripReaskBody:'改めてお尋ねします:以前のバージョンでは、この質問が表示される前に「今はしない」が保存されることがありました。',- stripChoices: { share: 'Nous と共有', local: 'このコンピューターに保存', off: '今はしない' },+ stripChoices: { share: 'Nous と共有', off: '今はしない' },stripDetails: '詳細'}diff --git a/apps/desktop/src/i18n/ru_shared_metrics.ts b/apps/desktop/src/i18n/ru_shared_metrics.tsindex 632227c2707..62953d1fb91 100644--- a/apps/desktop/src/i18n/ru_shared_metrics.ts+++ b/apps/desktop/src/i18n/ru_shared_metrics.ts@@ -13,21 +13,18 @@ export const ruSharedMetrics = {collectedUsage: 'Качество агента: неудачные правки, сломанные вызовы инструментов, зацикливания, стоимость задачи',collectedMachine: 'Компьютер: ОС, диапазон ОЗУ, тип GPU, версия Hermes, использование локальных моделей',sending:- 'Статистика остаётся на этом компьютере, если вы не выберете «Делиться». Общая статистика отправляется в Nous раз в день со случайным идентификатором этого профиля. Кроме разовой отметки об установке Hermes, которая учитывается только после вашего согласия, статистика до согласия никогда не отправляется. Изменить это можно в любой момент в настройках.',+ 'Если вы делитесь, Hermes раз в день отправляет статистику в Nous со случайным идентификатором этого профиля. Кроме разовой отметки об установке Hermes, статистика до вашего согласия никогда не отправляется. Изменить это можно в любой момент в настройках.',readDocs: 'Подробнее',share: 'Делиться с Nous',- local: 'Хранить на этом компьютере',off: 'Нет, спасибо',saveFailed: 'Не удалось сохранить выбор',- collectLabel: 'Собирать статистику использования',- collectDesc: 'Только счётчики, хранятся на этом компьютере. Никогда — ваши сообщения, файлы, пути или тексты ошибок.',sendLabel: 'Делиться статистикой использования с Nous',sendDesc:- 'Раз в день отправляет статистику в Nous со случайным идентификатором этого профиля. Кроме разовой отметки об установке, статистика за время до вашего согласия никогда не отправляется. Требует включённого сбора.',+ 'Только счётчики, раз в день со случайным идентификатором этого профиля. Никогда — ваши сообщения, файлы, пути или тексты ошибок.',unavailable: 'Обновите бэкенд Hermes, чтобы изменить этот параметр.',stripBody: 'Только счётчики. Никогда — ваши сообщения или файлы.',stripReaskBody:'Спрашиваем ещё раз: прежняя версия могла сохранить «Нет, спасибо» до того, как вы увидели этот вопрос.',- stripChoices: { share: 'Делиться с Nous', local: 'Хранить на этом компьютере', off: 'Нет, спасибо' },+ stripChoices: { share: 'Делиться с Nous', off: 'Нет, спасибо' },stripDetails: 'Подробнее'}diff --git a/apps/desktop/src/i18n/types_shared_metrics.ts b/apps/desktop/src/i18n/types_shared_metrics.tsindex b59bf655b11..4eafc3a0626 100644--- a/apps/desktop/src/i18n/types_shared_metrics.ts+++ b/apps/desktop/src/i18n/types_shared_metrics.ts@@ -13,16 +13,13 @@ export interface SharedMetricsTranslations {sending: stringreadDocs: stringshare: string- local: stringoff: stringsaveFailed: string- collectLabel: string- collectDesc: stringsendLabel: stringsendDesc: stringunavailable: stringstripBody: stringstripReaskBody: string- stripChoices: { share: string; local: string; off: string }+ stripChoices: { share: string; off: string }stripDetails: string}diff --git a/apps/desktop/src/i18n/zh-hant.ts b/apps/desktop/src/i18n/zh-hant.tsindex ac49f9c014a..01b2b52f1cd 100644--- a/apps/desktop/src/i18n/zh-hant.ts+++ b/apps/desktop/src/i18n/zh-hant.ts@@ -116,21 +116,17 @@ export const zhHantOverrides = {collectedUsage: '代理品質:未成功的編輯、損壞的工具呼叫、卡住的迴圈、每個任務的成本',collectedMachine: '機器:作業系統、記憶體範圍、GPU 類型、Hermes 版本、本機模型使用情況',sending:- '除非你選擇分享,否則統計資料只會保留在這台電腦上。分享的統計資料每天傳送給 Nous 一次,並附帶此設定檔的隨機 ID。除了一則 Hermes 已安裝的一次性記錄(僅在你同意後計入)之外,你同意之前的統計資料永遠不會被傳送。你可以隨時在設定中變更。',+ '如果你選擇分享,Hermes 每天傳送一次統計資料給 Nous,並附帶此設定檔的隨機 ID。除了一則 Hermes 已安裝的一次性記錄之外,你同意之前的統計資料永遠不會被傳送。你可以隨時在設定中變更。',readDocs: '查看完整說明',share: '與 Nous 分享',- local: '保留在這部電腦上',off: '不用了',saveFailed: '無法儲存你的選擇',- collectLabel: '收集使用統計',- collectDesc: '僅限計數,保留在這部電腦上。絕不包含你的訊息、檔案、路徑或錯誤文字。',sendLabel: '與 Nous 分享使用統計',- sendDesc:- '每天一次將統計資料連同此設定檔的隨機 ID 傳送給 Nous。除一次性的安裝記錄外,你同意之前的統計資料絕不會被傳送。需要先開啟收集。',+ sendDesc: '僅限計數,每天傳送一次,並附帶此設定檔的隨機 ID。絕不包含你的訊息、檔案、路徑或錯誤文字。',unavailable: '請更新 Hermes 後端以變更此設定。',stripBody: '僅限計數,絕不包含你的訊息或檔案。',stripReaskBody: '再次詢問:舊版本可能在你看到此問題之前就已儲存了「不用了」。',- stripChoices: { share: '與 Nous 分享', local: '保留在這部電腦上', off: '不用了' },+ stripChoices: { share: '與 Nous 分享', off: '不用了' },stripDetails: '詳細資訊'},firstRun: zhHantFirstRun,diff --git a/apps/desktop/src/i18n/zh_shared_metrics.ts b/apps/desktop/src/i18n/zh_shared_metrics.tsindex 9c61fe4abbd..f73fd9f3ff6 100644--- a/apps/desktop/src/i18n/zh_shared_metrics.ts+++ b/apps/desktop/src/i18n/zh_shared_metrics.ts@@ -12,20 +12,16 @@ export const zhSharedMetrics = {collectedUsage: '代理质量:未成功的编辑、出错的工具调用、卡住的循环、每个任务的成本',collectedMachine: '机器:操作系统、内存范围、GPU 类型、Hermes 版本、本地模型使用情况',sending:- '除非你选择分享,否则统计数据只保存在这台电脑上。分享的统计数据每天发送给 Nous 一次,并附带此配置文件的随机 ID。除了一条 Hermes 已安装的一次性记录(仅在你同意后计入)之外,你同意之前的统计数据永远不会被发送。你可以随时在设置中更改。',+ '如果你选择分享,Hermes 每天向 Nous 发送一次统计数据,并附带此配置文件的随机 ID。除了一条 Hermes 已安装的一次性记录之外,你同意之前的统计数据永远不会被发送。你可以随时在设置中更改。',readDocs: '查看完整说明',share: '分享给 Nous',- local: '仅保存在这台电脑上',off: '不用了',saveFailed: '无法保存你的选择',- collectLabel: '收集使用统计',- collectDesc: '仅包含计数,保存在这台电脑上。绝不包含你的消息、文件、路径或错误文本。',sendLabel: '与 Nous 分享使用统计',- sendDesc:- '每天一次将统计数据发送给 Nous,并附带此配置文件的随机 ID。除一次性的安装记录外,你同意之前的统计数据绝不会被发送。需要先开启收集。',+ sendDesc: '仅包含计数,每天发送一次,并附带此配置文件的随机 ID。绝不包含你的消息、文件、路径或错误文本。',unavailable: '请更新 Hermes 后端以更改此设置。',stripBody: '仅包含计数,绝不包含你的消息或文件。',stripReaskBody: '再次询问:旧版本可能在你看到此问题之前就已保存了“不用了”。',- stripChoices: { share: '分享给 Nous', local: '仅保存在本机', off: '不用了' },+ stripChoices: { share: '分享给 Nous', off: '不用了' },stripDetails: '详情'}diff --git a/apps/desktop/src/store/shared-metrics.ts b/apps/desktop/src/store/shared-metrics.tsindex 00c23ccf190..1e02b2e3fe9 100644--- a/apps/desktop/src/store/shared-metrics.ts+++ b/apps/desktop/src/store/shared-metrics.ts@@ -8,12 +8,11 @@ export const SHARED_METRICS_DOCS_URL = 'https://hermes-agent.nousresearch.com/doexport type SharedMetricsConsent = SharedMetricsConsentResult-/** The first-run answers, as the two config opt-ins `hermes setup` writes. */-export type SharedMetricsChoice = 'local' | 'off' | 'share'+/** The first-run answers, as the two config opt-ins `hermes setup` writes: each sets both. */+export type SharedMetricsChoice = 'off' | 'share'export const SHARED_METRICS_CHOICES: Record<SharedMetricsChoice, { enabled: boolean; send: boolean }> = {share: { enabled: true, send: true },- local: { enabled: true, send: false },off: { enabled: false, send: false }}diff --git a/hermes_cli/config_defaults.py b/hermes_cli/config_defaults.pyindex cb5d755900a..b9ec8522d41 100644--- a/hermes_cli/config_defaults.py+++ b/hermes_cli/config_defaults.py@@ -2338,7 +2338,7 @@ DEFAULT_CONFIG = {"run": None,},# Privacy-safe aggregate metrics in this profile's local telemetry dir. Collection (`enabled`)- # and transmission to Nous (`send`) are SEPARATE opt-ins; see+ # and upload to Nous (`send`) are separate keys that every consent surface sets together; see# website/docs/developer-guide/relay-shared-metrics.md Appendix A for consent/retention."telemetry": {"shared_metrics": {diff --git a/hermes_cli/observability/shared_metrics_consent.py b/hermes_cli/observability/shared_metrics_consent.pyindex b1313c962ae..9ab33d8b0d4 100644--- a/hermes_cli/observability/shared_metrics_consent.py+++ b/hermes_cli/observability/shared_metrics_consent.py@@ -1,11 +1,13 @@"""The one shared-metrics consent answer, and the terminal's first-run offer.Every surface reads and writes the same two keys in the profile's config.yaml:-``telemetry.shared_metrics.enabled`` (collect locally) and ``.send`` (upload daily). The question-counts as answered once either key is written explicitly; the shipped defaults are not an answer.-Every answer also writes ``offer_version``. A "No thanks" without it predates the type-ahead fix-(an Enter pressed during startup could save it unseen), so that profile is asked once more, with-the reason, and any response (Esc or dismiss included) settles it for good.+``telemetry.shared_metrics.enabled`` (collect) and ``.send`` (upload daily). The offer has two+answers, and each sets both keys: "Share with Nous" turns both on, "No thanks" turns both off. The+question counts as answered once either key is written explicitly; the shipped defaults are not an+answer. Every answer also writes ``offer_version``. A "No thanks" without it predates the type-ahead+fix (an Enter pressed during startup could save it unseen), so that profile is asked once more, with+the reason, and any response (Esc or dismiss included) settles it for good. A collect-only answer+from before the offer dropped that choice stays decided: nothing is sent, and it is not asked again.Desktop paints the offer as a composer strip (``consent-strip.tsx`` over the ``shared_metrics.*``RPCs). The terminal asks at the end of every ``hermes setup`` flow and, for a profile that neveranswered, once before an interactive ``hermes`` / ``hermes --tui`` chat (which also covers the@@ -22,10 +24,9 @@ from typing import Anylogger = logging.getLogger(__name__)-# (label, enabled, send): the Desktop strip's three equal answers, in its order.+# (label, enabled, send): the offer's two answers, in the order every surface shows them.OFFER_CHOICES = (- ("Collect and send to Nous", True, True),- ("Collect locally only", True, False),+ ("Share with Nous", True, True),("No thanks", False, False),)_NO_THANKS = len(OFFER_CHOICES) - 1@@ -33,12 +34,10 @@ DOCS_URL = "https://hermes-agent.nousresearch.com/docs/developer-guide/relay-sha_OFFER_DESCRIPTION = "\n".join(("Shared metrics are bounded counters: activity, outcomes, error classes (with a","fixed-list reason when a memory write, compression, update or install fails),",- "model routes, token totals, feature use and coarse machine facts. A failed or",- "finished fresh install is noted on this machine and counted only if you opt in.",- "Never prompts, files, paths,",- "setting values or error text. Collection stays on this machine; sending to Nous is",- "a separate choice, and apart from that install note, data from before you opt in",- "is never sent.",+ "model routes, token totals, feature use and coarse machine facts. Never prompts,",+ "files, paths, setting values or error text. Sharing sends them to Nous once a",+ "day. Apart from a one-time install note, data from before you opt in is never",+ "sent.",f"Details: {DOCS_URL}","Change it any time: hermes setup telemetry",))@@ -58,7 +57,8 @@ OFFER_VERSION = 2def consent_state(raw_cfg: Any) -> dict:"""``{enabled, send, decided, reask}`` from a RAW config mapping (no defaults merged). ``reask``:an "off" answer from before ``OFFER_VERSION`` that may never have been seen; it reads undecided- so every surface offers it once more. An opt-in was always a deliberate pick and stays."""+ so every surface offers it once more. An opt-in was always a deliberate pick and stays, including+ a collect-only answer from before the offer dropped that choice."""section = _section(raw_cfg)enabled = section.get("enabled") is Trueanswered = "enabled" in section or "send" in section@@ -120,7 +120,7 @@ def save_consent(enabled: bool, send: bool, config: dict | None = None) -> None:def offer_consent(config: dict | None = None, *, reask: bool = False) -> bool:- """Ask once, with the Desktop strip's three answers; "No thanks" is the default so Enter never+ """Ask once, with the offer's two answers; "No thanks" is the default so Enter neveropts anyone in. Esc leaves a first question open (asked again next time); on a re-ask it keepsthe recorded "No thanks", so nobody is asked a third time. True when answered."""from hermes_cli.cli_output import print_info, print_success@@ -142,7 +142,7 @@ def offer_consent(config: dict | None = None, *, reask: bool = False) -> bool:return False_, enabled, send = OFFER_CHOICES[idx]save_consent(enabled, send, config)- outcome = "collected and sent to Nous" if send else "collected on this machine only" if enabled else "off"+ outcome = "sent to Nous once a day" if send else "off"print_success(f"Shared metrics {outcome}. Change it any time with `hermes setup telemetry`.")return Truediff --git a/hermes_cli/setup.py b/hermes_cli/setup.pyindex 0ccb1599209..0d2bc4cfa56 100644--- a/hermes_cli/setup.py+++ b/hermes_cli/setup.py@@ -511,7 +511,7 @@ def setup_tools(config: dict, first_install: bool = False):_SEND_CONSENT_EXPLAINER = (- "", "Sending uploads each daily package to the Nous telemetry",+ "", "Sharing uploads each daily package to the Nous telemetry","service. Packages carry your profile-scoped install ID, a","stable random UUID that identifies this profile across days","(it contains no personal information and is reset by deleting",@@ -519,13 +519,13 @@ _SEND_CONSENT_EXPLAINER = ("collection period falls inside a recorded consent window are","ever sent. Apart from the fresh-install note (noted on this","machine and counted only once you opt in), data from before",- "you opt in, or from any gap while sending was off, stays on",- "this machine. Sending can be turned off again at any time.",+ "you opt in is never sent. Sharing can be turned off again at",+ "any time.",)def setup_telemetry(config: dict):- """Configure the local shared-metrics subscriber and optional sending."""+ """Turn shared metrics on (collect and send to Nous) or off: one answer sets both keys."""print_header("Shared Metrics")_info("Shared metrics contain only bounded counters: activity, session length,","outcomes, error classes (with a fixed-list reason when a memory write or",@@ -539,27 +539,21 @@ def setup_telemetry(config: dict):"settings are used or switched off, provider setup outcomes), and coarse","machine facts (RAM range, GPU type, version age and channel, updates behind,","local model server yes/no). Never prompts, files, paths, setting values or",- "error text.",- "Collection is local. Sending them to Nous is a separate opt-in.")+ "error text.")+ _info(*_SEND_CONSENT_EXPLAINER)# The answer is written to config.yaml here, not by the caller's later save: that save strips# values equal to the defaults, so a "no" would vanish and every surface would ask again.from hermes_cli.observability.shared_metrics_consent import save_consentshared_metrics = _sub_dict(_sub_dict(config, "telemetry"), "shared_metrics")- if not prompt_yes_no("Enable local shared metrics?", default=shared_metrics.get("enabled") is True):- print_info("Local shared metrics disabled.")- # Sending cannot outlive collection; turning collection off withdraws send consent too.- if shared_metrics.get("send") is True:- print_info("Sending shared metrics disabled as well.")- save_consent(False, False, config)- return- print_success("Local shared metrics enabled.")- _info(*_SEND_CONSENT_EXPLAINER)- save_consent(True, prompt_yes_no("Send shared metrics to Nous?", default=shared_metrics.get("send") is True), config)- if shared_metrics["send"]:- print_success("Sending shared metrics enabled.")+ sharing = shared_metrics.get("enabled") is True and shared_metrics.get("send") is True+ # One answer for both keys: off also withdraws send consent and stops collection.+ share = prompt_yes_no("Send shared metrics to Nous?", default=sharing)+ save_consent(share, share, config)+ if share:+ print_success("Shared metrics sent to Nous once a day.")else:- print_info("Sending shared metrics disabled (collection stays local).")+ print_info("Shared metrics off.")def _record_send_consent_change(*, enabled: bool) -> None:diff --git a/hermes_cli/tools_config.py b/hermes_cli/tools_config.pyindex 4c99538f004..b06337093ce 100644--- a/hermes_cli/tools_config.py+++ b/hermes_cli/tools_config.py@@ -931,9 +931,10 @@ def _shared_metrics_state(config: dict) -> tuple[bool, bool]:def _shared_metrics_menu_label(config: dict) -> str:- """Menu row for shared metrics, showing both consent states."""+ """Menu row for shared metrics. Collect-only is an answer the offer no longer has; a profile+ that chose it earlier keeps it, and the row names it rather than reading "off" while it collects."""enabled, send = _shared_metrics_state(config)- state = "off" if not enabled else ("collecting + sending to Nous" if send else "collecting locally")+ state = "off" if not enabled else ("sending to Nous" if send else "collecting locally")return f"Configure shared metrics ({state})"diff --git a/locales/_keys.desktop.json b/locales/_keys.desktop.jsonindex 332e2723828..736b3e0deaf 100644--- a/locales/_keys.desktop.json+++ b/locales/_keys.desktop.json@@ -4218,8 +4218,6 @@"settings.vault.stateField","settings.vault.title","settings.vault.twoFactorBadge",- "sharedMetrics.collectDesc",- "sharedMetrics.collectLabel","sharedMetrics.collectedActivity","sharedMetrics.collectedMachine","sharedMetrics.collectedMilestones",@@ -4230,7 +4228,6 @@"sharedMetrics.consentBody","sharedMetrics.consentTitle","sharedMetrics.dialogTitle",- "sharedMetrics.local","sharedMetrics.off","sharedMetrics.readDocs","sharedMetrics.saveFailed",@@ -4239,7 +4236,6 @@"sharedMetrics.sending","sharedMetrics.share","sharedMetrics.stripBody",- "sharedMetrics.stripChoices.local","sharedMetrics.stripChoices.off","sharedMetrics.stripChoices.share","sharedMetrics.stripDetails",diff --git a/tests/hermes_cli/test_setup_telemetry.py b/tests/hermes_cli/test_setup_telemetry.pyindex 93abca37429..9a0ca9fa214 100644--- a/tests/hermes_cli/test_setup_telemetry.py+++ b/tests/hermes_cli/test_setup_telemetry.py@@ -13,16 +13,39 @@ def test_shared_metrics_are_registered_disabled_by_default():assert DEFAULT_CONFIG["telemetry"]["shared_metrics"]["enabled"] is False-def test_setup_telemetry_enables_shared_metrics(monkeypatch):+def test_setup_telemetry_one_answer_sets_both_keys(monkeypatch):+ """One question: yes collects and sends, no turns both off. Collect-only is not offered."""+ asked = []+ monkeypatch.setattr(+ "hermes_cli.setup.prompt_yes_no",+ lambda question, default: asked.append(question) or not default,+ )config = {}++ setup_telemetry(config)+ assert config["telemetry"]["shared_metrics"]["enabled"] is True+ assert config["telemetry"]["shared_metrics"]["send"] is True++ setup_telemetry(config)+ assert config["telemetry"]["shared_metrics"]["enabled"] is False+ assert config["telemetry"]["shared_metrics"]["send"] is False+ assert asked == ["Send shared metrics to Nous?"] * 2+++def test_setup_telemetry_defaults_a_collect_only_profile_to_no(monkeypatch):+ """A retired collect-only answer is not sharing: the question defaults to no, and no turns+ collection off too."""+ defaults = []monkeypatch.setattr("hermes_cli.setup.prompt_yes_no",- lambda _question, default: not default,+ lambda _question, default: defaults.append(default) or default,)+ config = {"telemetry": {"shared_metrics": {"enabled": True, "send": False}}}setup_telemetry(config)- assert config["telemetry"]["shared_metrics"]["enabled"] is True+ assert defaults == [False]+ assert config["telemetry"]["shared_metrics"]["enabled"] is Falsedef test_disabling_collection_closes_the_send_consent_window(monkeypatch, tmp_path):@@ -100,7 +123,7 @@ def test_chat_offer_asks_an_undecided_profile_once(monkeypatch):from hermes_cli.observability import shared_metrics_consent as consentasked = []- monkeypatch.setattr("hermes_cli.curses_ui.curses_radiolist", lambda *a, **k: asked.append(a) or 1)+ monkeypatch.setattr("hermes_cli.curses_ui.curses_radiolist", lambda *a, **k: asked.append(a) or 0)monkeypatch.setattr("sys.stdin.isatty", lambda: True)monkeypatch.setattr("sys.stdout.isatty", lambda: True)monkeypatch.delenv("HERMES_DESKTOP", raising=False)@@ -112,7 +135,8 @@ def test_chat_offer_asks_an_undecided_profile_once(monkeypatch):consent.offer_consent_before_chat(argparse.Namespace())assert len(asked) == 1- assert consent.consent_state(read_raw_config()) == {"enabled": True, "send": False, "decided": True, "reask": False}+ assert asked[0][1] == ["Share with Nous", "No thanks"]+ assert consent.consent_state(read_raw_config()) == {"enabled": True, "send": True, "decided": True, "reask": False}def test_offer_drops_keys_typed_before_it_appeared(monkeypatch):@@ -130,7 +154,8 @@ def test_offer_drops_keys_typed_before_it_appeared(monkeypatch):def test_unseen_no_thanks_is_asked_once_more_and_then_settled(monkeypatch):"""A pre-fix "No thanks" is re-offered with the reason; Esc on the re-ask keeps it for good,- while a pre-fix opt-in was a deliberate pick and is never re-asked."""+ while a pre-fix opt-in (sharing, or the collect-only answer the offer no longer has) was a+ deliberate pick and is never re-asked."""from hermes_cli.config import read_raw_config, save_configfrom hermes_cli.observability import shared_metrics_consent as consent@@ -141,8 +166,9 @@ def test_unseen_no_thanks_is_asked_once_more_and_then_settled(monkeypatch):monkeypatch.delenv("HERMES_DESKTOP", raising=False)monkeypatch.delenv("HERMES_NONINTERACTIVE", raising=False)- save_config({"telemetry": {"shared_metrics": {"enabled": True, "send": False}}}, strip_defaults=False)- consent.offer_consent_before_chat(argparse.Namespace())+ for send in (True, False):+ save_config({"telemetry": {"shared_metrics": {"enabled": True, "send": send}}}, strip_defaults=False)+ consent.offer_consent_before_chat(argparse.Namespace())assert shown == []save_config({"telemetry": {"shared_metrics": {"enabled": False, "send": False}}}, strip_defaults=False)diff --git a/tests/hermes_cli/test_shared_metrics_tools_toggle.py b/tests/hermes_cli/test_shared_metrics_tools_toggle.pyindex 3d4dd9a1fed..6994d7e8b50 100644--- a/tests/hermes_cli/test_shared_metrics_tools_toggle.py+++ b/tests/hermes_cli/test_shared_metrics_tools_toggle.py@@ -34,7 +34,14 @@ class TestMenuLabel:def test_sending_state_names_the_destination(self):label = _shared_metrics_menu_label(_config(enabled=True, send=True))- assert "sending to Nous" in label+ assert "(sending to Nous)" in label++ def test_retired_collect_only_answer_is_named_rather_than_read_off(self):+ label = _shared_metrics_menu_label(_config(enabled=True, send=False))+ assert "(collecting locally)" in label++ def test_off(self):+ assert "(off)" in _shared_metrics_menu_label(_config(enabled=False, send=False))class TestToggle:diff --git a/tests/tui_gateway/test_shared_metrics_consent_rpc.py b/tests/tui_gateway/test_shared_metrics_consent_rpc.pyindex 4296f10ecf4..59daf323bf3 100644--- a/tests/tui_gateway/test_shared_metrics_consent_rpc.py+++ b/tests/tui_gateway/test_shared_metrics_consent_rpc.py@@ -72,6 +72,12 @@ def test_status_is_undecided_until_a_key_is_written(tmp_path, monkeypatch):_call("shared_metrics.set", {"profile": "code", "enabled": False, "send": False})assert _call("shared_metrics.status", {"profile": "code"}) == {**unasked, "decided": True}+ # A collect-only answer (no longer offered) from before the offer had versions stays decided.+ (worker / "config.yaml").write_text(+ yaml.safe_dump({"telemetry": {"shared_metrics": {"enabled": True, "send": False}}}), encoding="utf-8")+ assert _call("shared_metrics.status", {"profile": "code"}) == {+ "enabled": True, "send": False, "decided": True, "reask": False}+def test_only_the_first_run_answer_records_desktop_setup_completed(tmp_path, monkeypatch):_launch, _worker = _bind_homes(monkeypatch, tmp_path)diff --git a/web/src/components/SharedMetricsConsentBanner.tsx b/web/src/components/SharedMetricsConsentBanner.tsxindex 0665e1a4eb5..535c93c53ab 100644--- a/web/src/components/SharedMetricsConsentBanner.tsx+++ b/web/src/components/SharedMetricsConsentBanner.tsx@@ -10,7 +10,7 @@ const STORAGE_KEY = "sharedMetricsOfferDismissed";/*** The dashboard's first-run shared-metrics offer: the twin of Desktop's composer strip and the- * terminal's offer, with the same three equal answers. Shown while the managed profile has no+ * terminal's offer, with the same two equal answers. Shown while the managed profile has no* answer in its config.yaml; answering writes it (every surface then stops asking), while the X* only hides the banner for this browser session. A re-ask (``reask``) is the exception: its X* keeps the recorded "No thanks", so nobody is asked a third time.@@ -89,16 +89,13 @@ export function SharedMetricsConsentBanner() {? (t.app.sharedMetricsReaskBody ??'Asking once more: an earlier version could save "No thanks" before you saw this question.'): (t.app.sharedMetricsBody ??- "Shared metrics are bounded counters, never prompts, files, paths or error text. Collection stays on this machine; sending to Nous is a separate choice.")}{" "}+ "Shared metrics are bounded counters, never prompts, files, paths or error text. Sharing sends them to Nous once a day.")}{" "}<a href={DOCS_URL} target="_blank" rel="noreferrer" className="underline">{t.app.sharedMetricsDetails ?? "Details"}</a></span><button type="button" disabled={saving} className={choice} onClick={() => answer(true, true)}>- {t.app.sharedMetricsShare ?? "Send to Nous"}- </button>- <button type="button" disabled={saving} className={choice} onClick={() => answer(true, false)}>- {t.app.sharedMetricsLocal ?? "Local only"}+ {t.app.sharedMetricsShare ?? "Share with Nous"}</button><button type="button" disabled={saving} className={choice} onClick={() => answer(false, false)}>{t.app.sharedMetricsOff ?? "No thanks"}diff --git a/web/src/i18n/en.ts b/web/src/i18n/en.tsindex 53cdbb34b5a..9d2fe491386 100644--- a/web/src/i18n/en.ts+++ b/web/src/i18n/en.ts@@ -115,11 +115,10 @@ export const en: Translations = {dismiss: "Dismiss",sharedMetricsTitle: "Help improve Hermes?",sharedMetricsBody:- "Shared metrics are bounded counters, never prompts, files, paths or error text. Collection stays on this machine; sending to Nous is a separate choice.",+ "Shared metrics are bounded counters, never prompts, files, paths or error text. Sharing sends them to Nous once a day.",sharedMetricsReaskBody:"Asking once more: an earlier version could save \"No thanks\" before you saw this question.",- sharedMetricsShare: "Send to Nous",- sharedMetricsLocal: "Local only",+ sharedMetricsShare: "Share with Nous",sharedMetricsOff: "No thanks",sharedMetricsDetails: "Details",sharedMetricsSaveFailed: "Couldn't save your choice",diff --git a/web/src/i18n/types.ts b/web/src/i18n/types.tsindex 4fa9c691c2d..cac661b053d 100644--- a/web/src/i18n/types.ts+++ b/web/src/i18n/types.ts@@ -135,7 +135,6 @@ export interface Translations {sharedMetricsBody?: string;sharedMetricsReaskBody?: string;sharedMetricsShare?: string;- sharedMetricsLocal?: string;sharedMetricsOff?: string;sharedMetricsDetails?: string;sharedMetricsSaveFailed?: string;diff --git a/website/docs/developer-guide/relay-shared-metrics.md b/website/docs/developer-guide/relay-shared-metrics.mdindex f0eb605665f..147cc683c12 100644--- a/website/docs/developer-guide/relay-shared-metrics.md+++ b/website/docs/developer-guide/relay-shared-metrics.md@@ -766,8 +766,11 @@ telemetry:- Like `enabled`, `send` is profile-owned and is not overridden bymanaged-scope configuration.-Both keys are asked once per profile, with the same three answers everywhere-(Send to Nous / Local only / No thanks):+Both keys are asked once per profile, with the same two answers everywhere+(Share with Nous / No thanks). Each answer sets both keys: "Share with Nous"+writes `enabled: true, send: true`, "No thanks" writes both false. The keys stay+separate so the sender keeps its own gate. Collecting without sending is no+longer offered; a hand-edited config can still set it.| Surface | Where the offer appears || --- | --- |@@ -788,9 +791,13 @@ was starting could save "No thanks" before the question appeared. A "No thanks"recorded without `offer_version` is therefore offered once more on every surface,with a note saying why. Any response settles it for good, including Esc or thebanner's ✕, which keep "No thanks". Answers that opted in are never re-asked.-To change the answer++The offer used to have a third answer that collected without sending ("Local+only" / "Keep on this computer"). Profiles that chose it keep it and are not+asked again; nothing is sent. Desktop's switch reads off for them and the+`hermes tools` row reads "collecting locally". To change the answerlater, use `hermes setup telemetry`, `hermes tools`, or Desktop's Settings ›-Safety › Privacy & network.+Safety › Privacy & network; each offers the same single on/off choice.**A package is only sent when its whole period falls inside a recordedconsent window.** Consent is stored as explicit intervals in the shared-