Skip to content

Commit 631c674

Browse files
authored
feat(update): enable passive upgrade nudge (opt out with VASTAI_NO_UPDATE_CHECK) (#439)
1 parent f84d485 commit 631c674

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

docs/install-design.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,9 @@ Not built in v1.
171171

172172
## 7. Passive update nudge
173173

174-
> **Status: implemented but disabled.** The call is commented out in
175-
> `main.py` — updates are manual via `vastai update` for now. Re-enable the
176-
> two lines when we want the per-command check (the logic and tests below all
177-
> exist and pass).
174+
> **Status: enabled.** `notify_update(args)` runs as a post-command hook in
175+
> `main.py`. Opt out with `VASTAI_NO_UPDATE_CHECK=1` (also off under
176+
> `--raw`/`CI`/non-TTY).
178177
179178
- After commands: at most **one manifest GET and one stderr line per 24h**, hard
180179
1s timeout, every failure silent with 24h backoff (offline machines pay ≤1s

vastai/cli/main.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,11 @@ def quote_completions(self, completions: List[str], cword_prequote: str, last_wo
157157
try:
158158
res = args.func(args)
159159

160-
# Passive upgrade nudge — disabled for now (manual `vastai update`).
161-
# from vastai.cli.selfupdate import notify_update; notify_update(args)
160+
# Passive upgrade nudge: best-effort, ≤1 manifest GET + ≤1 stderr
161+
# line per 24h, silent when offline/piped/CI. Never raises. Opt out
162+
# with VASTAI_NO_UPDATE_CHECK=1. See selfupdate.py and §7.
163+
from vastai.cli.selfupdate import notify_update
164+
notify_update(args)
162165

163166
if args.raw and res is not None:
164167
try:

0 commit comments

Comments
 (0)