Skip to content

feat(status): surface update availability in mcpproxy status + dedupe startup update log#798

Merged
Dumbris merged 2 commits into
mainfrom
feat/079-status-update-info
Jul 2, 2026
Merged

feat(status): surface update availability in mcpproxy status + dedupe startup update log#798
Dumbris merged 2 commits into
mainfrom
feat/079-status-update-info

Conversation

@Dumbris

@Dumbris Dumbris commented Jul 2, 2026

Copy link
Copy Markdown
Member

Motivation

Spec 079 (Upgrade Awareness & Guided Update) targets the ~60% of active installs running pre-v0.40 builds that never learn a newer version exists. This PR is a deliberate first slice of US1 (universal, non-intrusive upgrade awareness): it surfaces the existing background update-check result in mcpproxy status — the command far-behind users actually run — and stops the startup log from re-announcing the same version every 4h tick.

What this slice does NOT include (follow-ups within spec 079):

  • The "N releases / M weeks behind" delta framing (FR-002) — noted as a follow-up in the code; this slice shows latest version + release URL only
  • The dismissible Web UI banner and tray surfaces (US1 scenarios 3–5)
  • Channel detection and one-line update commands (US2)
  • update_check.* config knobs / CI-quiet semantics (US3)

Implementation

  • cmd/mcpproxy/status_cmd.go: new StatusUpdateInfo struct (available, latest_version, release_url, checked_at, is_prerelease, check_error) mirroring InfoResponseUpdate. extractStatusUpdate() pulls it from the daemon's GET /api/v1/info payload — single source of truth, no second GitHub call (FR-001). statusVersionSuffix() renders the Version line exactly like doctor: v0.45.0 (update available: v0.46.0 — <release URL>) when behind, (latest) when a successful check confirmed currency, and nothing when check_error is set or no check has completed. JSON/YAML output gains an optional update object (omitted when the daemon reports none).
  • internal/updatecheck/checker.go: the existing "Update available" zap Info line fired on every successful 4h check while behind. Added announcedVersion dedupe so each latest version is announced exactly once (US1 scenario 2: "exactly one informational log line ... does not nag repeatedly for the same version").
  • docs/cli/status-command.md: documented the new output.

TDD: failing tests written and confirmed red before implementation (cmd/mcpproxy/status_update_test.go, internal/updatecheck/checker_test.go).

Codex review

Reviewed by codex; findings applied in fce24ab4:

  • Status update object was missing checked_at / is_prerelease that /api/v1/info carries — now mirrored 1:1.
  • FR-002 ("N releases / M weeks behind") explicitly marked as a follow-up rather than silently absent.

Verification

Live end-to-end on this branch (HEAD fce24ab4), daemon built as v0.40.0:

  • Build note: -X main.version alone is insufficient — the checker reads internal/httpapi.buildVersion (internal/server/server.go rt.SetVersion(httpapi.GetBuildVersion())), so both ldflags were set, matching the Makefile.
  • Update-available path: with the daemon behind latest, mcpproxy status shows v0.40.0 (update available: vX.Y.Z — <release URL>) and JSON output carries the update object; startup log announces the update exactly once, with no repeat on subsequent check ticks for the same version.
  • Environment gotcha found during verification: status reaches the daemon via the Unix socket, and macOS's 104-char sun_path limit rejects long data-dir paths (bind: invalid argument) — used a short data dir for the live run.
  • go test for the touched packages passes.

Part of specs/079-upgrade-nudge.

🤖 Generated with Claude Code

Dumbris and others added 2 commits July 2, 2026 13:58
… startup update log

First slice of specs/079-upgrade-nudge US1 (FR-003, FR-004): make the
existing background update check visible where users actually look.

## Changes
- mcpproxy status: Version line now mirrors doctor's presentation —
  "vX (update available: vY — <release URL>)" when behind, "(latest)"
  after a successful check confirms currency, and a plain version when
  the check failed or has not completed (quiet on failure, FR-020).
- mcpproxy status -o json/yaml: new optional "update" object
  (available, latest_version, release_url, check_error) extracted from
  the daemon's GET /api/v1/info payload — no second check pipeline
  (FR-001); check_error is retained in machine output for diagnostics.
- internal/updatecheck: the "Update available" zap Info line is now
  announced exactly once per detected latest version per process
  (dedupe by version); repeat 4h ticks for the same version log at
  Debug only, so startup gets one clear line without timer spam.
- docs/cli/status-command.md: document the update annotation and the
  JSON update field.

## Assumptions (zero-interruption policy)
- Human output stays silent on check_error / not-yet-checked rather
  than showing an error state; JSON keeps check_error for diagnostics
  (per FR-019/FR-020 machine-readable-still-reports-facts).
- "(latest)" is only shown when latest_version is non-empty, i.e. a
  successful check actually confirmed currency.
- No config block, channel detection, delta computation, or Web UI
  banner in this slice — later 079 slices.

## Testing
- New cmd/mcpproxy/status_update_test.go: suffix rendering table,
  table output, JSON contract (present/omitted), info-payload
  extraction incl. check_error.
- New checker tests with zap observer: once-per-version Info dedupe
  incl. error+recovery, re-announce on newer version, silent when
  current.
- go build ./cmd/mcpproxy; go test -race ./internal/updatecheck/...
  ./cmd/mcpproxy/...; golangci-lint v2 (.github/.golangci.yml): clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… mark FR-002 delta follow-up

Review follow-ups on the US1 status slice (specs/079-upgrade-nudge):

- StatusUpdateInfo now carries checked_at (RFC 3339 string, staleness
  signal for consumers of `status -o json`) and is_prerelease, so it is
  an accurate mirror of the /api/v1/info update object as the code
  comment and docs claim (FR-019/FR-021). Extraction + JSON wire-format
  tests extended; docs example updated.
- Added explicit TODO(spec-079/FR-002) markers at the two surfaces that
  will grow the "N releases / M weeks behind" delta (statusVersionSuffix
  and the checker's one-shot Info log). The delta needs the release list
  + publish dates, which the checker does not fetch yet — owned by a
  later 079 slice, intentionally not in this one.
- FR-004 once-per-version (vs once-per-process) Info announce is kept
  as-is: the operative clause is "MUST NOT repeatedly log the same
  availability on a timer", and per-version re-announce matches the
  Web UI banner's per-version dismissal semantics (FR-005); a genuinely
  newer release is new information. Locked in by checker_test.go.

Testing: go test -race ./internal/updatecheck/... ./cmd/mcpproxy/...;
golangci-lint v2 (.github/.golangci.yml) on touched packages: clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: fce24ab
Status: ✅  Deploy successful!
Preview URL: https://318fd6fd.mcpproxy-docs.pages.dev
Branch Preview URL: https://feat-079-status-update-info.mcpproxy-docs.pages.dev

View logs

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 97.36842% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/mcpproxy/status_cmd.go 96.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

📦 Build Artifacts

Workflow Run: View Run
Branch: feat/079-status-update-info

Available Artifacts

  • archive-darwin-amd64 (28 MB)
  • archive-darwin-arm64 (25 MB)
  • archive-linux-amd64 (16 MB)
  • archive-linux-arm64 (14 MB)
  • archive-windows-amd64 (28 MB)
  • archive-windows-arm64 (25 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (21 MB)
  • installer-dmg-darwin-arm64 (19 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 28585872934 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@Dumbris Dumbris merged commit 12cd2bb into main Jul 2, 2026
38 checks passed
@Dumbris Dumbris deleted the feat/079-status-update-info branch July 2, 2026 15:50
Dumbris added a commit that referenced this pull request Jul 2, 2026
…ne, connect-trust/upgrade-nudge progress (#803)

check-github now passes with 0 errors: scanner-simplification epic
complete (#786/#792/#793/#794 incl. deep-scan trust fixes + docs
sweep); connect-trust US1 preview (#802) + backup visibility (#799)
done; upgrade-nudge status/log slice (#798) split out as done with
the banner+config remainder tracked separately; telemetry machine_id
client (#796) and hygiene check-github (#800) done. Remaining
warnings are the known windows-tray no-PR-evidence items.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants