Upgrading from inside the gstack checkout no longer reinstalls Codex you removed (#4835) (#4850)

Running `./setup --refresh-registered` (what `/gstack-upgrade` runs)
from inside the gstack checkout no longer puts Codex skills back into
`~/.codex/skills` after you removed them.

Why: upgrades should refresh only the installs you have. Reported by
@schubter. Fixes #4835.

Nothing to do: the next upgrade refreshes only the installs you actually
have.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
Garry Tanandcapy-ai[bot] authored and GitHub committed 2026-11-26 16:46:54 +00:00
1 parent aa503e29f4
commit 0febbce1e4
3 files changed
+57 -5

No files matched your search

+5 -4
View File
@@ -244,6 +244,8 @@ _gstack_vendored_source() {
# gstack_install_known_roots — "host<TAB>scope<TAB>destination<TAB>install_root"
# for every location setup can install into, global and (inside a git repo)
# project-local. Used to discover installs made before the registry existed.
# Inside a gstack checkout, its own .agents/skills/gstack is its Codex render,
# not a project install, so that root is left out (#4835).
gstack_install_known_roots() {
local claude_dir codex_dir proj
claude_dir="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/skills"
@@ -263,7 +265,9 @@ gstack_install_known_roots() {
proj="$(git rev-parse --show-toplevel 2>/dev/null || true)"
if [ -n "$proj" ] && [ "$proj" != "$HOME" ]; then
printf 'claude\tproject\t%s\t%s\n' "$proj/.claude/skills" "$proj/.claude/skills/gstack"
printf 'codex\tproject\t%s\t%s\n' "$proj/.agents/skills" "$proj/.agents/skills/gstack"
if [ "$(_gstack_install_source "$proj/.agents/skills/gstack")" != "$(cd "$proj" 2>/dev/null && pwd -P)" ]; then
printf 'codex\tproject\t%s\t%s\n' "$proj/.agents/skills" "$proj/.agents/skills/gstack"
fi
fi
}
@@ -299,9 +303,6 @@ ROWS
seen="$seen$root|"
src="$(_gstack_install_source "$root")"
[ -n "$src" ] || continue
case "$root" in */.agents/skills/gstack)
[ "$(cd "${root%/.agents/skills/gstack}" 2>/dev/null && pwd -P)" = "$src" ] && continue ;;
esac
cur="$(cat "$src/VERSION" 2>/dev/null || echo '-')"
note="installed before the registry; register it: cd $src && ./setup --host $host"
if [ "$scope" = global ] && [ "$host" != claude ] && _gstack_vendored_source "$src"; then