Repository navigation
fix(telemetry): show enabled state in Settings (web+macOS) — materialize telemetry.enabled in /api/v1/config - #681
Merged
Conversation
Telemetry is opt-out (default enabled), but DefaultConfig leaves the Telemetry field nil and Enabled is a pointer with omitempty. On a fresh install the /api/v1/config response omitted the telemetry key entirely, so the web UI (SettingField !!modelValue) and macOS (?? false) coerced the missing bool to false and displayed telemetry as DISABLED — even though Config.IsTelemetryEnabled() and the CLI correctly reported it enabled. Fix at the contract/response boundary: mirror IsTelemetryEnabled() into a copy of the config before marshaling so telemetry.enabled is always present, without mutating the shared config or changing the Go default-true logic. One server-side fix covers both UI clients. Related #MCP-2477
Deploying mcpproxy-docs with
|
| Latest commit: |
6a653f8
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ee7f3c50.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://fix-mcp-2477-telemetry-seria.mcpproxy-docs.pages.dev |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 27542136102 --repo smart-mcp-proxy/mcpproxy-go
|
Dumbris
added a commit
that referenced
this pull request
Jun 15, 2026
Conflict from #685 (instructions prefill) + #681 (telemetry serialization) landing on main while this branch was in review. Resolved Settings.vue: - imports: union of watch (prefill) + nextTick/useRoute (banner focus deep-link) - onMounted: keep #685's watch(defaultInstructions) prefill trigger, use this branch's async onMounted for the focus query-param handling, drop the duplicate loadConfig() (body already awaits loadConfig()). Verified: 14 settings unit tests pass (instructions-prefill + prefill-dirty). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem (MCP-2477)
On a fresh install, web UI and macOS Settings show Telemetry as DISABLED, even though telemetry is enabled-by-default and
mcpproxy telemetry statuscorrectly reports "Enabled". This is a display/serialization bug, not a config-default bug.Root cause
Config.IsTelemetryEnabled()returnstruewhenTelemetry/Enabledare nil (internal/config/config.go:1716)./api/v1/configserializes the raw config (ConvertConfigToContractreturnscfgas-is).Telemetry *TelemetryConfigandEnabled *boolboth haveomitempty, andDefaultConfig()never setsTelemetry→ thetelemetrykey is omitted from the response on a fresh install.false: web UISettingField.vue!!modelValue, macOSConfigSettingsView.swift?? false.Fix
Materialize the resolved
telemetry.enabledvalue at the contract/response boundary before marshaling — mirrorIsTelemetryEnabled()into a copy of the config (no mutation of the shared config, no change to the Go default-true logic). One server-side fix covers both UI clients.cfg.Telemetry == nil→ emittelemetry.enabled = IsTelemetryEnabled()(true on fresh install)cfg.Telemetry.Enabled == nil→ emit resolved value (true)enabled: false→ preserved (opt-out respected)Tests (TDD)
Added to
internal/contracts/converters_test.go— watched all fail first, then pass:TestConvertConfigToContract_TelemetryMaterializedOnFreshDefault— freshDefaultConfig()→ JSON containstelemetry.enabled: true; asserts the source config is not mutated.TestConvertConfigToContract_TelemetryEnabledNilMaterialized—Telemetrypresent,Enablednil → true.TestConvertConfigToContract_TelemetryExplicitFalsePreserved— explicit opt-out preserved.Verification
go build ./...✅go test ./internal/contracts/... ./internal/config/... ./internal/httpapi/... -race✅golangci-lint run --config .github/.golangci.yml ./internal/contracts/...→ 0 issues ✅Acceptance
/api/v1/config→telemetry.enabled: truemcpproxy telemetry statusunchanged (Go logic untouched)go build ./... && go test ./internal/...Related #MCP-2477