diff --git a/scripts/install.sh b/scripts/install.sh index 78cf1122..4e26b708 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -921,7 +921,22 @@ install_aider() { local dest="${PWD}/CONVENTIONS.md" [[ -f "$src" ]] || { err "integrations/aider/CONVENTIONS.md missing. Run convert.sh first."; return 1; } if [[ -f "$dest" ]]; then - warn "Aider: CONVENTIONS.md already exists at $dest (remove to reinstall)." + # Never overwrite: CONVENTIONS.md is aider's own user-authored file, and the + # one sitting here may well be the reader's rather than ours. But the guard + # used to strand the very users this integration was fixed for — anyone + # holding the pre-index roster (3.8M characters, far past what aider can keep + # in context for a session) re-ran the installer, read "already exists", and + # kept the broken file. Our generated file has always opened with the same + # marker, so tell our stale copy apart from someone else's conventions. + if head -n 1 "$dest" | grep -q 'The Agency'; then + local bytes; bytes="$(wc -c < "$dest" | tr -d ' ')" + warn "Aider: $dest is an Agency roster index from an earlier install ($bytes bytes)." + dim " The roster is an index now, not the agents themselves. Delete it and" + dim " re-run this installer to pick up the smaller file." + else + warn "Aider: CONVENTIONS.md already exists at $dest — leaving your file alone." + dim " Remove it and re-run to install the Agency roster index instead." + fi return 0 fi install_file "$src" "$dest"