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
Today the only way to disable the auto-updater for a single binary invocation is to set the OBJECTIVEAI_SKIP_UPDATE env var. Add a native CLI flag so it's discoverable via --help and doesn't require shell-env wrapping.
Scope
All four binaries that link the shared updater carry the updater feature:
Each calls objectiveai_sdk::updater::maybe_auto_update(...) from within a #[cfg(feature = "updater")] block. The check that gates execution today lives in objectiveai-sdk-rs/src/updater.rs::imp::run:
if std::env::var_os(SKIP_ENV_VAR).is_some(){emit_notification(
config.handle.as_ref(),Updater::Skipped{reason:SkipReason::OptedOut},).await;returnOk(());}
Suggested approach
Add a flag — --no-update (or --skip-update) — at the binary level. Recognized BEFORE the binary's own argument parsing (or as a global pre-parse step) so the updater check sees it before any per-binary handling kicks in.
When set, short-circuit the call to maybe_auto_update entirely (skip the function call rather than going through the env-var check). Emits the same Skipped { reason: OptedOut } notification so consumers see consistent JSONL.
Pre-parse implementation: scan args for the flag before passing it through to clap. Strip it from argv so downstream parsers don't see it.
Why
--help discoverability — currently the only way to learn about the opt-out is by reading source.
Test ergonomics — every integration test wanting a stable update behavior currently sets OBJECTIVEAI_SKIP_UPDATE=1 in the environment.
Symmetric with the existing OBJECTIVEAI_SKIP_UPDATE env var which is set by the re-exec'd child to break update loops.
Cross-binary interaction
The CLI's update-check fires self-update for the CLI; api/mcp/viewer have their own. A --no-update flag passed to the CLI does not affect api/mcp/viewer if launched separately. Each binary owns its own flag. No cross-binary fan-out.
Out of scope
Removing the env var (stays as the secondary source).
Today the only way to disable the auto-updater for a single binary invocation is to set the
OBJECTIVEAI_SKIP_UPDATEenv var. Add a native CLI flag so it's discoverable via--helpand doesn't require shell-env wrapping.Scope
All four binaries that link the shared updater carry the
updaterfeature:objectiveai-cli/src/main.rs)objectiveai-api/src/main.rs)objectiveai-mcp-cli/src/main.rs)objectiveai-viewer/src-tauri/src/main.rs)Each calls
objectiveai_sdk::updater::maybe_auto_update(...)from within a#[cfg(feature = "updater")]block. The check that gates execution today lives inobjectiveai-sdk-rs/src/updater.rs::imp::run:Suggested approach
--no-update(or--skip-update) — at the binary level. Recognized BEFORE the binary's own argument parsing (or as a global pre-parse step) so the updater check sees it before any per-binary handling kicks in.maybe_auto_updateentirely (skip the function call rather than going through the env-var check). Emits the sameSkipped { reason: OptedOut }notification so consumers see consistent JSONL.argsfor the flag before passing it through toclap. Strip it from argv so downstream parsers don't see it.Why
--helpdiscoverability — currently the only way to learn about the opt-out is by reading source.OBJECTIVEAI_SKIP_UPDATE=1in the environment.OBJECTIVEAI_SKIP_UPDATEenv var which is set by the re-exec'd child to break update loops.Cross-binary interaction
The CLI's update-check fires self-update for the CLI; api/mcp/viewer have their own. A
--no-updateflag passed to the CLI does not affect api/mcp/viewer if launched separately. Each binary owns its own flag. No cross-binary fan-out.Out of scope
Related