Skip to content

gstack-upgrade only re-registers Claude Code; Codex / OpenCode installs silently drift #1925

Closed

Description

@abkrim

Summary

/gstack-upgrade (and the ./setup it runs) re-registers skills only for Claude Code. On a machine where gstack was also installed for Codex (and potentially OpenCode), those agents are never refreshed by the upgrade, so they silently drift to older versions. Over time this produces multiple divergent gstack installs across agents.

Environment

  • macOS (Apple Silicon)
  • gstack primary (Claude Code): ~/.claude/skills/gstack — v1.57.0.0
  • gstack clone backing Codex: ~/gstack (Codex symlinks ~/.codex/skills/gstack-* → ~/gstack/.agents/skills/) — v1.26.3.0 (31 versions behind)
  • OpenCode: no gstack skills registered

I run gbrain + gstack across Claude Code, Codex and OpenCode. gbrain handles multi-agent cleanly (single binary + per-agent MCP; one bun install updates all). gstack exposes multi-agent setup flags, but the upgrade path isn't host-aware, so the agents fall out of sync after every upgrade with no warning.

Root cause (from reading setup + the gstack-upgrade skill)

  • setup defaults to HOST="claude"; multi-agent registration only happens with an explicit --host codex|opencode|auto.
  • --host auto already auto-detects installed agents (command -v claude|codex|kiro-cli|droid|opencode) and registers all of them.
  • The /gstack-upgrade skill runs bare ./setup (no --host), so every upgrade re-registers only Claude Code. Codex / OpenCode keep pointing at whatever clone they were first set up from and drift.
  • Side note: setup already has migrate_direct_codex_install, so the project clearly anticipates multi-clone Codex installs — but the upgrade path doesn't keep them current.

Expected

The upgrade re-registers every host gstack was installed for, not just Claude — and ideally warns when a registered agent's version differs from the primary.

Possible fixes

  1. Quick: have /gstack-upgrade run ./setup --host auto instead of bare ./setup. Safe — auto falls back to claude when no other agent CLI is present. Trade-off: auto-detect can register gstack into an agent the user didn't deliberately choose.
  2. Proper: persist the set of installed hosts at setup time (e.g. in ~/.gstack/config.yaml) and have the upgrade re-run setup for exactly those hosts; warn on per-host version drift.

Happy to send a PR for whichever direction you prefer.

Activity

  1. Oszkar commented on Jul 8, 2026

    @Oszkar

    Independent data point that reproduces this, worse:

    My setup:

    • Primary (Claude Code): ~/.claude/skills/gstack — was on v1.58.0.0, 4 commits behind origin/main.
    • Secondary install: ~/.agents/skills/gstack — a fully independent git clone (own .git, same origin/garrytan/gstack.git remote), frozen at v1.17.0.0 — 75 commits / ~41 versions behind. git merge-base --is-ancestor confirms it's a straight-line ancestor of the primary, not a fork — pure staleness, no divergence.

    So the drift is real and can get worse than the 31-versions-behind case in the original report — mine had apparently never been touched since initial install.

    One addition to the two fixes proposed above: I read through gstack-upgrade/SKILL.md's Step 2 install-type detection, and there's a structural reason a fix limited to ./setup --host auto won't fully close this for everyone:

    if [ -d "$HOME/.claude/skills/gstack/.git" ]; then
      INSTALL_TYPE="global-git"; INSTALL_DIR="$HOME/.claude/skills/gstack"
    elif [ -d "$HOME/.gstack/repos/gstack/.git" ]; then ...
    elif [ -d ".claude/skills/gstack/.git" ]; then ...        # cwd-relative
    elif [ -d ".agents/skills/gstack/.git" ]; then ...        # cwd-relative

    Branch 1 ($HOME/.claude/skills/gstack/.git) is checked unconditionally, before cwd is even considered. On any machine where the primary Claude install exists — which is the common case, since Claude is the primary host — branches 3 and 4 are unreachable: there's no cwd you can invoke /gstack-upgrade from that lets it pick anything other than the primary Claude clone. That's fine for fix 1 (teaching ./setup to pass --host auto) if the secondary install is a proper Codex/OpenCode registration symlinked from the primary — re-running the primary's ./setup --host auto would refresh it correctly.

    But it doesn't help a case like mine, where the secondary is a fully separate, standalone clone rather than a registration produced by the primary's own ./setup. gstack-upgrade has no way to even discover that clone exists, so no amount of host-awareness inside ./setup reaches it — Step 2 would need to enumerate all known gstack install locations (primary + every registered host's target, e.g. by reading whatever persists installed hosts per fix 2) rather than assuming there's exactly one relevant INSTALL_DIR per invocation.

    Fix 2 (persist installed hosts + re-run setup for each, with per-host version-drift warnings) seems like the only one of the two that actually generalizes to this shape of install. Happy to test a PR against this scenario if useful.

  2. time-attack commented on Jul 15, 2026

    @time-attack
    Contributor

    @abkrim Secondary host registrations still drift, and upgrades lack a durable record of which hosts and installation targets must be refreshed.

  3. abkrim commented on Jul 16, 2026

    @abkrim
    Author

    Thanks @Oszkar and @time-attack for confirming this — two more data points that the drift is real and that --host auto alone doesn't fully close it.

    Agreed with @Oszkar's structural read: Fix 1 (/gstack-upgrade → ./setup --host auto) only refreshes secondaries that are registrations symlinked from the primary — my Codex case (~/.codex/skills/gstack-* → ~/gstack/.agents/skills/). It can't reach a standalone secondary clone with its own .git, because Step 2's install-type detection resolves to the primary ~/.claude/skills/gstack unconditionally and never enumerates other install locations. @time-attack's phrasing nails the missing piece — there's no durable record of which hosts and installation targets must be refreshed, which is exactly Fix 2.

    On my side I've adopted ./setup --host auto after every /gstack-upgrade as a stop-gap and it keeps my Codex registration current — but I only trust it because I also enforce "one primary clone, no orphan standalone clones" operationally. That discipline shouldn't be a prerequisite for the upgrade being correct. So I'd back Fix 2 (persist installed hosts + targets at setup time, re-run per host on upgrade, warn on per-host version drift) as the direction that generalizes. Still happy to send a PR for it if you want to lock the shape first.

  4. capy-ai commented on Oct 3, 2026

    @capy-ai
    Contributor

    Fixed in v1.91.16.0 (#3014, ac20ef1): /gstack-upgrade now refreshes every registered install (Claude, Codex, OpenCode and the rest), each in its own process, and ends with one result row per install. ./setup --status lists them. Covered by test/host-conformance.test.ts and test/setup-install-registry.test.ts.

    Thanks for the report! If it still happens on v1.91.16.0 or later, reply here and we'll reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions