Skip to content

feat(desktop): settings toggle for opt-in agent metrics#4034

Merged
esengine merged 1 commit into
main-v2from
feat/desktop-metrics-settings
Jun 11, 2026
Merged

feat(desktop): settings toggle for opt-in agent metrics#4034
esengine merged 1 commit into
main-v2from
feat/desktop-metrics-settings

Conversation

@esengine

Copy link
Copy Markdown
Owner

Phase 3 of the opt-in agent metrics: the user-facing Settings toggle. With this, the feature is fully wired end-to-end — worker /v1/metrics (live), desktop aggregator (#4033), and now a way to turn it on.

What it adds

  • Settings toggle under Updates, mirroring the telemetry-ping wiring across every layer: SettingsView.Metrics, SetDesktopMetrics bound method, bridge AppBindings + dev mock, the panel ToggleSegment, and en/zh strings.
  • The hint is the disclosure: it states only enumerated counters ship (finish reason, cache-hit rate, error/tool-failure categories) — never conversations, prompts, keys, or paths. Default off, so nothing happens until the user flips it.
  • Live toggle: SetDesktopMetrics starts/stops the aggregator immediately, and a.metrics is now an atomic.Pointer so the hot event sink reads it race-free while the setting flips mid-session.

Test

  • go build ./..., go test ./ (desktop) — pass
  • SetDesktopMetrics is mirrored in the hand-written AppBindings + dev mock, so the binding-drift check stays satisfied; frontend tsc runs in CI.

This completes the telemetry track. Worker is already deployed; this ships in the next desktop build.

Surfaces the desktop.metrics opt-in in Settings, mirroring the telemetry
ping wiring end to end: SettingsView field, the SetDesktopMetrics bound
method, the bridge AppBindings + dev mock, and the panel toggle with a
disclosure hint (en + zh). The hint is the disclosure — it spells out that
only enumerated counters ship, never conversations, prompts, keys, or paths.

SetDesktopMetrics starts/stops the aggregator live so the toggle takes
effect immediately, and a.metrics becomes an atomic.Pointer so the event
sink reads it race-free while the setting flips mid-session.
@esengine esengine requested a review from SivanCola as a code owner June 11, 2026 12:05
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) labels Jun 11, 2026
@esengine esengine merged commit 83f1e04 into main-v2 Jun 11, 2026
14 checks passed
@esengine esengine deleted the feat/desktop-metrics-settings branch June 11, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant