Skip to content

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

Merged
capy-ai[bot] merged 1 commit into
mainfrom
setup-refresh-skips-checkout-codex-render
Nov 26, 2026
Merged

capy-ai[bot] merged 1 commit into
mainfrom
setup-refresh-skips-checkout-codex-render

Conversation

@garrytan

@garrytan garrytan commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

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.

What changed

Inside the gstack checkout, the checkout's own Codex render is no longer listed as a project install

Inside the gstack checkout, the checkout's own Codex render is no longer listed as a project install.

Tests
Before/after as text: Inside the gstack checkout, the checkout's own Codex render is no longer listed as a project install
--- Before · before.txt · captured output
+++ After · after.txt · captured output
+$ cd ~/.local/share/gstack && gstack_install_known_roots | grep project   # after
-$ cd ~/.local/share/gstack && gstack_install_known_roots | grep project   # before
 claude	project	~/.local/share/gstack/.claude/skills	~/.local/share/gstack/.claude/skills/gstack
-codex	project	~/.local/share/gstack/.agents/skills	~/.local/share/gstack/.agents/skills/gstack
 

A user with only a Claude install removed ~/.codex/skills/gstack, ran the upgrade from inside their gstack checkout, and got Codex reinstalled globally. The checkout keeps its own Codex skill render at .agents/skills/gstack, and the upgrade's search for older installs treated that folder as a Codex install inside a project. Since the checkout lives under ~/.claude/skills, setup then installed Codex globally and added it back to the checkout's installed hosts.

The list of places setup checks for older installs (gstack_install_known_roots in bin/gstack-install-registry.sh) now leaves out the project Codex folder when it resolves, with symlinks followed, to the same checkout as the project root. A separate project that keeps its own gstack copy at .agents/skills/gstack is still found and refreshed. ./setup --status had its own copy of this check, which is removed now that the shared list does it.

Why

gstack's install rules say an upgrade refreshes exactly the installs you registered and never brings back one you removed (docs/ADDING_A_HOST.md, rule 3). This bug broke that rule for anyone who upgrades from inside their checkout.

Blast radius

The list feeds three callers, which are the upgrade's discovery of older installs (setup), ./setup --status, and the first record of a checkout's installed hosts (gstack_render_hosts_seed in bin/gstack-host-renders.sh). All three now ignore only a folder that resolves to the checkout it sits in, which was already what --status did; the new tests run the real ./setup for both the checkout case and the vendored-project case, and the existing install, host-render and Codex-scope tests pass unchanged.

Pre-Landing Review

No blocking issues. The second reviewer noted one low-severity side effect, listed below and not fixed here.

Review notes

Below the blocking floor; recorded here and not fixed in this PR.

Documentation

Status: current. The docs already match this change, so nothing was edited.

Scope: the diff from base 8982588 to HEAD 8145261 (bin/gstack-install-registry.sh, the changelog fragment and test/setup-install-registry.test.ts), with no staged, unstaged or new files. I searched the docs for --refresh-registered, .agents/skills/gstack and install-registry discovery.

Documentation health:

  • docs/ADDING_A_HOST.md: Current. Rule 3 already says upgrades refresh only the registered installs, and the fix brings the code back in line with it.
  • docs/troubleshooting.md: Current. Its Quick answers still describe project installs at .agents/skills/gstack correctly.
  • docs/hosts.md: Current.
  • docs/capy-install.md: Current.
  • changelog.d/setup-refresh-skips-checkout-codex-render.md: Current. It is accurate and plain; CHANGELOG.md is not touched.

Coverage debt: none. This is a bug fix that adds no public command, flag or environment variable. Diagram drift: none.

Issues

Fixes #4835

Agent notes

Refs GST-4007. Credit: @schubter reported #4835.

Approvals

No approvals recorded for branch setup-refresh-skips-checkout-codex-render.
Plan: exempt: bug fix with a failing-first test (R65)
Plan check: exempt bug fix

REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=1 fixed=0 scope=frozen dispatches=1
Gate edits: none detected (3 listed, 1 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)

{
  "schema_version": 1,
  "pr": 4850,
  "head": "814526154a18af166b79c60f1c04e172b801360b",
  "version": "1.104.0.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 1723,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 45858357140,
      "attempt": 1,
      "tree": "c4206bf3ad41fcd55a34f358938e2dc0370fe8a3"
    }
  ],
  "calls": 10,
  "session_kind": "unattended",
  "run": "ship-4850",
  "head_tree": "c4206bf3ad41fcd55a34f358938e2dc0370fe8a3",
  "product_patch_id": "92b98641b2ab7d307078f29fd7918480331e9371",
  "gstack_version": "1.104.0.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 9,
    "rules": "33831f8248a814fd",
    "base": "aa503e29f4e620a2ab689172c7fb261c7b280874",
    "registry": "aa503e29f4e620a2ab689172c7fb261c7b280874",
    "gate_scan": {
      "tagged": 0,
      "head": "814526154a18af166b79c60f1c04e172b801360b"
    },
    "reasons": [
      "runtime=9"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "pass @c4206bf3ad41 (8 checks, current for 814526154a18)",
  "issues": {
    "fixes": [
      4835
    ],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, CONTRIBUTING.md (searched for --refresh-registered, .agents/skills/gstack and install-registry discovery)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 1,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "dispatches": {
      "specialist": 1
    }
  },
  "gate_dispositions": []
}

…you removed (#4835)

The gstack checkout's own .agents/skills/gstack is its Codex render, not a project install, so the known install roots leave it out. A separate project's vendored copy is still discovered. Reported by @schubter.

Fixes #4835

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@capy-ai
capy-ai Bot merged commit 0febbce into main Nov 26, 2026
58 of 59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

setup: --refresh-registered reinstalls Codex globally from the checkout's own .agents render

1 participant