From 3722084bca90aba537ad855c8f3b64b66b24b4a7 Mon Sep 17 00:00:00 2001 From: Abir Abbas Date: Mon, 17 Aug 2026 16:11:46 -0400 Subject: [PATCH] fix(install): make --no-aforge / AFORGE_MODE=none actually skip the aforge download MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The installer only skipped its own explicit `af aforge ensure` step, but `af skill install --all` (which runs first) triggers the same best-effort aforge provisioning hook (skillkit/install.go), so a user who opted out still got the 35 MB binary downloaded into ~/.agentfield/bin. Regressed with #924, which added both the hook and the flag. Export AGENTFIELD_SKIP_AFORGE=1 for the whole run when AFORGE_MODE=none — that env gate is the single switch the Go side honours — so every `af` (and af-tray) invocation the script makes respects the opt-out. Verified against v0.1.130-rc.5 into an isolated HOME: patched installer with --no-aforge installs af + skills + furrow and no aforge; the unpatched script installs aforge despite the flag. Co-Authored-By: Claude Fable 5 --- scripts/install.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/install.sh b/scripts/install.sh index 3bf165645..f79313d21 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -48,6 +48,9 @@ TRAY_MODE="${TRAY_MODE:-auto}" # spawn it for LLM work, so a machine with af but no aforge fails at the first # harness call. The download/verify/upgrade rules live in Go, so this installer # only decides WHETHER to ask for it. Opt out with --no-aforge or AFORGE_MODE=none. +# Opting out also exports AGENTFIELD_SKIP_AFORGE=1 for every `af` call this +# script makes: `af skill install` runs the same best-effort aforge hook, so +# without the env gate the binary would be downloaded anyway. AFORGE_MODE="${AFORGE_MODE:-auto}" # Extra flags forwarded to `af-tray install` (see --defer-restart / --take-over). @@ -818,6 +821,14 @@ main() { # Parse command line arguments parse_args "$@" + # --no-aforge / AFORGE_MODE=none must hold for the whole install, not just + # the explicit `af aforge ensure` step: `af skill install` (and af-tray) run + # the same provisioning hook, and AGENTFIELD_SKIP_AFORGE=1 is the one switch + # the Go side honours (control-plane/internal/aforge). + if [[ "$AFORGE_MODE" == "none" ]]; then + export AGENTFIELD_SKIP_AFORGE=1 + fi + # Set install directory based on channel set_install_dir