You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(update): toggle auto-update via /update auto, /settings, and info (#133)
* feat(update): toggle auto-update via /update auto, /settings, and info
Add an in-app way to turn silent startup auto-updates on or off:
- `/update auto on|off` (and `/update auto` reports the effective state)
- an effective-state-aware row in the interactive `/settings` panel
- auto-update status in `pythinker info`
All surfaces show the effective state: an external override
(PYTHINKER_CLI_NO_AUTO_UPDATE or a source checkout) is surfaced as the
reason and renders the /settings row read-only, so the toggle is never a
silent no-op.
Extract the pure policy resolver into a shell-free `update_policy` module so
`pythinker info` reports status without importing the shell stack, and add
`create=False` to get_share_dir/get_config_file so the read-only info path no
longer materializes ~/.pythinker as a side effect.
* refactor(update): address review — drop re-export indirection, narrow excepts
- Repoint consumers (shell __init__, /update, /settings) and tests to import
auto_update_enabled / auto_update_override_reason directly from the canonical
`update_policy` module, and drop the unused re-export shims from
ui/shell/update.py (resolves "unused import" findings).
- Narrow the broad `except Exception` in `info._auto_update_info` to
(OSError, ValueError, ImportError) and log the degraded path instead of
silently swallowing (C03); ConfigError/pydantic errors are ValueError.
- Narrow `update_policy.is_running_from_source_checkout` to
(ImportError, AttributeError, OSError).
- Strengthen the /update auto persist tests to assert real on-disk persistence
via load_config rather than mock call-coupling.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,8 @@ GitHub Releases page; `0.8.0` is the new starting line.
15
15
16
16
## Unreleased
17
17
18
+
-**Toggle auto-update from the CLI.**`/update auto on|off` turns silent startup auto-updates on or off (and `/update auto` reports the effective state); the same toggle now appears in the interactive `/settings` panel, and `pythinker info` reports the auto-update status. All three show the *effective* state — an external override (`PYTHINKER_CLI_NO_AUTO_UPDATE` or a source checkout) is surfaced as the reason and renders the `/settings` row read-only, so the toggle is never a silent no-op.
19
+
18
20
## 0.43.0 (2026-06-13)
19
21
20
22
-**Silent startup auto-updates (default on).** Managed and native installs now check for and apply updates in the background at startup, surfacing a restart-to-apply notice instead of a blocking prompt. Opt out with `auto_update = false` in config or `PYTHINKER_AUTO_UPDATE=0` in the environment. The Windows update path that replaces the running binary no longer escapes as an uncaught `SystemExit` and crashes the shell.
0 commit comments