Add ambient update notice for interactive TTY sessions#358
Conversation
Detect outdated Claude Code plugin installations by comparing the installed plugin version against the CLI version. Show a warning in `basecamp doctor` and a one-time post-upgrade hint pointing users to enable auto-update in Claude Code. The setup wizard now recommends enabling auto-update after plugin installation.
There was a problem hiding this comment.
Pull request overview
Adds a best-effort, non-blocking CLI update check that can display an ambient “update available” notice on stderr for interactive TTY sessions, backed by a 24h on-disk cache under the global config directory.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Changes:
- Introduces
UpdateCheck+ cache read/write helpers and a background version fetch (StartUpdateCheck,Notice). - Hooks the update check into the root command lifecycle (start in
PersistentPreRunE, print notice inPersistentPostRunEwhen interactive). - Adds unit tests covering dev/opt-out, cache freshness behavior, background fetch behavior, and non-blocking notice semantics.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| internal/commands/update_notice.go | Implements background update checking and a disk cache for latest version discovery. |
| internal/commands/update_notice_test.go | Adds tests for cache behavior and non-blocking notice generation. |
| internal/cli/root.go | Wires the update check into CLI startup/shutdown and conditionally prints the notice. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e5309aef32
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
e5309ae to
d4e7c3f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d4e7c3f6ec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The version mismatch check was in the generic agent Checks list, causing the setup wizard and other callers to treat a version difference as 'plugin not installed'. The version check now only appears in `basecamp doctor`.
d4e7c3f to
4c0b178
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c0b1787b3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Show a non-intrusive update notice on stderr when a newer CLI version is available. Uses a background goroutine with a 24-hour cache to avoid adding latency to commands. Respects BASECAMP_NO_UPDATE_CHECK=1 and suppresses output for non-interactive or machine consumers.
4c0b178 to
573334f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 573334fe13
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Doctor already has its own live version check — showing the ambient notice on top of it would be redundant.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
PersistentPreRunE— zero added latency~/.config/basecamp/.update-checkto avoid hitting GitHub API on every invocationBASECAMP_NO_UPDATE_CHECK=1env var to opt out--json,--agent,--quiet, piped output)basecamp upgradeandbasecamp doctor(which have their own version checks)Stacked on #357 (plugin-update-awareness) since both modify
root.go'sPersistentPostRunE.Test plan
TestStartUpdateCheck_SkipsDevBuild— nil for dev buildsTestStartUpdateCheck_SkipsWhenEnvSet— nil when env var setTestStartUpdateCheck_UsesFreshCache— uses cached version without networkTestStartUpdateCheck_StaleCacheFetchesInBackground— fires goroutine on stale cacheTestStartUpdateCheck_NoCacheFetchesInBackground— fires goroutine on missing cacheTestNotice_NonBlocking— returns empty without blocking on unfinished goroutine