Commit ed42d46
feat(update): update_check config block + dismissible Web UI update banner (Spec 079 US1) (#805)
* feat(update): update_check config block with hot-reload + env precedence (Spec 079 US1)
Add the update_check.{enabled,channel} config group (FR-012/FR-013):
- enabled (default true) gates BOTH the background poll and the manual
CheckNow (/api/v1/info?refresh=true) path; when disabled no network
check runs and GetVersionInfo returns nil so /api/v1/info omits the
update object entirely — every surface (banner, badge, status/doctor
annotation) goes quiet (FR-015).
- channel: "stable" (default; prereleases never offered) or "rc"
(prereleases included), validated; the config-file equivalent of
MCPPROXY_ALLOW_PRERELEASE_UPDATES.
- Precedence (FR-014): the existing env switches WIN over config —
MCPPROXY_DISABLE_AUTO_UPDATE=true force-disables and
MCPPROXY_ALLOW_PRERELEASE_UPDATES=true force-includes prereleases.
The spec leaves precedence open; env-wins is the operator-override
reading, documented in code and docs.
- Hot-reload: DetectConfigChanges reports "update_check"; ApplyConfig
(API path) and ReloadConfiguration (disk path) both re-gate the
running checker. The background loop now stays alive while
config-disabled, and a re-enable/channel switch triggers a prompt
re-check instead of waiting up to the 4h interval.
- make swagger: config.UpdateCheckConfig surfaced on config.Config.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(web): dismissible per-version update banner on the dashboard (Spec 079 US1)
FR-005: non-modal alert banner on the dashboard when the checker reports
an update — "Update available: vX — you are running vY" with a
release-notes link and a dismiss (X) button. Dismissal persists the
dismissed latest_version in localStorage, so the same version never
re-nags across reloads while a newer release shows the banner again.
The existing sidebar badge + manual-check toast are unchanged.
When update_check.enabled=false the daemon omits the update object from
/api/v1/info, so the banner (and badge) are naturally absent; the manual
"check for updates" action now says checks are disabled instead of the
misleading "You are running the latest version".
Tests: 6 vitest cases (render, no-update, absent update object,
dismiss persists, stays dismissed on remount, newer version reappears).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* docs(update): document update_check config block, env-var precedence, and the Web UI banner (Spec 079 US1)
- features/version-updates.md: update_check.{enabled,channel} reference,
hot-reload behavior, explicit env-vs-config precedence (env wins, one
direction only), config-based examples, dismissible per-version banner.
- configuration.md + configuration/config-file.md (served reference):
new Update Check sections + complete-reference key.
- configuration/environment-variables.md: auto-update table is core+tray
(not tray-only) and points at the config-file equivalent.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(update): review fixes — tray honors update_check.enabled, no stale nudge/cache
Address Codex review findings on the Spec 079 US1 branch:
- Go tray self-update (major): the tray's independent daily release check
(checkForUpdates) now reads update_check.enabled from the shared config
file and skips the network check when disabled (FR-015: no check on any
surface). Fails open on missing/unreadable config, matching the pre-079
default; MCPPROXY_DISABLE_AUTO_UPDATE still wins (FR-014). Full FR-001a
convergence (tray consuming the shared checker, incl. channel) remains a
separate 079 work item — docs updated to say exactly that.
- Tray stale nudge (minor): checkUpdateFromAPI treats an absent update
object in /api/v1/info (checker disabled via hot-reload) as "no update",
clearing state and hiding the menu item instead of returning early and
leaving a stale "New version available" entry until restart.
- Checker races (minor): SetConfig now bumps a config generation and drops
the cached VersionInfo on any effective change; check() captures the
generation and updateVersionInfo discards results from a stale generation
or while disabled. An in-flight check can no longer publish/announce after
disable, and a channel switch or re-enable never briefly serves
wrong-channel cached info (FR-013/FR-015).
- UpdateBanner (minor): localStorage reads/writes wrapped in try/catch,
degrading to session-only dismissal when storage is blocked (precedent:
stores/system.ts), so blocked storage cannot break Dashboard setup.
Tests: new unit tests for the tray config gate, the stale-nudge clear
(httptest core stub), the checker generation/disable races, and a
blocked-localStorage banner spec. go test -race, vitest (253 pass),
golangci-lint v2, and make build all green.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* docs(update): sync REST/CLI/prerelease docs with update_check gating
- rest-api.md: /api/v1/info omits the update object when checking is
disabled (update_check.enabled=false or MCPPROXY_DISABLE_AUTO_UPDATE);
note refresh=true no-ops while disabled and point at the update_check
config block.
- cli/status-command.md: document the disabled case (no update object,
version shown without annotation).
- prerelease-builds.md: RC opt-in now also possible via
update_check.channel=rc for the core checker (Go tray self-update check
stays env-only until FR-001a).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(update): tray gate honors --config override; check() re-reads enabled
Codex final-review findings on PR #805 (Spec 079 US1):
- Major: ServerAdapter.GetConfigPath() hardcoded ~/.mcpproxy/mcp_config.json,
ignoring MCPPROXY_TRAY_CONFIG_PATH — the very path the tray launches core
with as --config (buildCoreArgs). So the update_check gate read the wrong
file under a custom config path and failed open, letting the tray-owned
daily GitHub check run despite update_check.enabled=false. Resolve the env
override first, matching what core actually uses.
- Minor: check() captured cfgGen but not the enabled flag, so a disable racing
after the caller's outer Enabled() gate (loop tick / re-enable goroutine)
still issued a GitHub request. The generation guard dropped the result, but
the request fired — violating FR-015 "no network check on any surface".
Re-read enabled under the same lock as gen and bail before checkFunc.
Both covered by new tests.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(update): tray gates self-update via core API, not config file
The tray must interact with the core only over the socket/REST API and
hold no state (CLAUDE.md). The previous update-check gate violated this by
calling config.LoadFromFile on the core's mcp_config.json.
Replace updateCheckEnabledByConfig with fetchCoreUpdateInfo, which asks the
core via GET /api/v1/info (the same endpoint checkUpdateFromAPI uses). The
core omits the update object when update_check.enabled=false, making its
config the single source of truth:
- core reports an update object -> run the legacy GitHub self-update flow
- core omits the update object -> skip (checking disabled / no update)
- core unreachable -> skip this tick (do not fall open to a
network check the operator may have disabled); the 24h ticker retries
checkUpdateFromAPI now shares fetchCoreUpdateInfo. File-based gate tests are
replaced with API-based ones asserting the network path (injected
selfUpdateFunc) runs only when the core reports an update.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent c39e9b7 commit ed42d46
25 files changed
Lines changed: 1324 additions & 47 deletions
File tree
- cmd/mcpproxy-tray/internal/api
- docs
- api
- cli
- configuration
- features
- frontend
- src
- components
- stores
- views
- tests/unit
- internal
- config
- runtime
- tray
- updatecheck
- oas
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
307 | 308 | | |
308 | 309 | | |
309 | 310 | | |
310 | | - | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
311 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
312 | 320 | | |
313 | 321 | | |
314 | 322 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
645 | 645 | | |
646 | 646 | | |
647 | 647 | | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
793 | 793 | | |
794 | 794 | | |
795 | 795 | | |
796 | | - | |
| 796 | + | |
797 | 797 | | |
798 | 798 | | |
799 | 799 | | |
| |||
802 | 802 | | |
803 | 803 | | |
804 | 804 | | |
805 | | - | |
| 805 | + | |
806 | 806 | | |
807 | 807 | | |
808 | 808 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
1033 | 1034 | | |
1034 | 1035 | | |
1035 | 1036 | | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
1036 | 1080 | | |
1037 | 1081 | | |
1038 | 1082 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
| |||
112 | 116 | | |
113 | 117 | | |
114 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
115 | 136 | | |
116 | 137 | | |
117 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
122 | 127 | | |
123 | 128 | | |
124 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
40 | 46 | | |
41 | 47 | | |
42 | 48 | | |
| |||
55 | 61 | | |
56 | 62 | | |
57 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
58 | 99 | | |
59 | 100 | | |
60 | 101 | | |
61 | 102 | | |
62 | 103 | | |
63 | 104 | | |
64 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
65 | 120 | | |
66 | 121 | | |
67 | 122 | | |
68 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
69 | 127 | | |
70 | 128 | | |
71 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
72 | 133 | | |
73 | 134 | | |
74 | 135 | | |
| |||
127 | 188 | | |
128 | 189 | | |
129 | 190 | | |
130 | | - | |
| 191 | + | |
131 | 192 | | |
132 | 193 | | |
133 | 194 | | |
| |||
136 | 197 | | |
137 | 198 | | |
138 | 199 | | |
139 | | - | |
| 200 | + | |
| 201 | + | |
140 | 202 | | |
141 | 203 | | |
142 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
0 commit comments