Run the CLI update check in non-interactive shells so agents see it

This commit is contained in:
Gregory Schier
2026-08-14 12:27:38 -07:00
parent def7d752db
commit 0068be9ffc
2 changed files with 7 additions and 5 deletions
@@ -170,3 +170,6 @@ check the status.
5. Never write a real secret into an environment variable on the user's behalf.
Reference one and let them fill in the value.
6. Verify what you built by sending it, and report the real HTTP status.
7. If the CLI warns on stderr that a newer version is available, offer to run
the upgrade command it prints, then re-run `yaak agent install` so this
skill updates too.
+4 -5
View File
@@ -47,6 +47,8 @@ struct VersionCheckRequest<'a> {
install_source: String,
platform: &'a str,
arch: &'a str,
// False when stdout is piped, e.g. a coding agent driving the CLI
interactive: bool,
}
pub async fn maybe_check_for_updates() {
@@ -102,11 +104,7 @@ fn should_skip_check() -> bool {
return true;
}
if std::env::var("CI").is_ok() {
return true;
}
!std::io::stdout().is_terminal()
std::env::var("CI").is_ok()
}
async fn fetch_version_check() -> Option<VersionCheckResponse> {
@@ -118,6 +116,7 @@ async fn fetch_version_check() -> Option<VersionCheckResponse> {
install_source: install_source(),
platform: std::env::consts::OS,
arch: std::env::consts::ARCH,
interactive: std::io::stdout().is_terminal(),
};
let client = yaak_api_client(ApiClientKind::Cli, current_version).ok()?;