Skip to content

fix(update-check): default to swxtchio/gstack fork, not public garrytan/gstack#1

Open
swx-geeter wants to merge 7 commits into
swxtchfrom
fix/update-check-fork-source
Open

fix(update-check): default to swxtchio/gstack fork, not public garrytan/gstack#1
swx-geeter wants to merge 7 commits into
swxtchfrom
fix/update-check-fork-source

Conversation

@swx-geeter

Copy link
Copy Markdown

Problem

bin/gstack-update-check hard-defaults its upgrade source to the public upstream garrytan/gstack, not this fork:

REMOTE_URL="${GSTACK_REMOTE_URL:-https://raw.githubusercontent.com/garrytan/gstack/main/VERSION}"
REMOTE_REPO="${GSTACK_REMOTE_REPO:-https://github.com/garrytan/gstack.git}"

Every dev on the fork (branch swxtch) therefore gets UPGRADE_AVAILABLE prompts — and the ls-remote SHA resolution — computed against the public repo's main, not swxtchio/gstack@swxtch. Silent only while the two happen to match versions; the moment swxtch pins or holds back, the notifier nags toward (and an upgrade could pull from) the wrong source, over the SWX: customizations.

The only current workaround is per-machine GSTACK_REMOTE_URL/REPO env vars in each dev's shell profile — easy to miss, doesn't scale to the team.

Change

Point the defaults (and the ls-remote branch + SHA URL) at swxtchio/gstack@swxtch:

  • REMOTE_URLraw.githubusercontent.com/swxtchio/gstack/swxtch/VERSION
  • REMOTE_REPOgithub.com/swxtchio/gstack.git
  • git ls-remote ... refs/heads/mainrefs/heads/swxtch
  • _SHA_URLswxtchio/gstack/${_REMOTE_SHA}/VERSION

GSTACK_REMOTE_URL / GSTACK_REMOTE_REPO env overrides are still honored (tests/mirrors), so a vanilla-upstream clone can still point at garrytan.

Follow-up worth discussing

A more robust version would auto-detect: if the install has a swxtch remote (or HEAD tracks swxtch/*), derive the source from it and fall back to upstream only when no fork remote exists — so both fork checkouts and vanilla clones are correct without hardcoding. Happy to do that instead if preferred.

Test

  • Fork checkout: gstack-update-check now compares local VERSION against swxtchio/gstack@swxtch.
  • Env override still wins: GSTACK_REMOTE_URL=... gstack-update-check uses the override verbatim.

Surfaced while syncing a dev machine that was 11 commits / one minor (1.57.7.01.58.1.0) behind the fork while correctly on the swxtch branch, but the notifier was watching garrytan/gstack.

brentyates-swx and others added 7 commits June 16, 2026 21:38
Mirrors /codex's three-mode pattern (review / challenge / consult)
using the Gemini CLI. Pinned to gemini-3.1-pro-preview at highest
available reasoning depth, --approval-mode plan for read-only.

Architecturally divergent from Claude (different training paradigm),
making gemini valuable as an outside voice — agreement = stronger
signal, disagreement = better blind-spot coverage. When /codex is
also available, running both gives three-way independent review.

Files:
- gemini/SKILL.md.tmpl — source template (mirrors codex/SKILL.md.tmpl)
- gemini/SKILL.md — auto-generated, regenerate via bun run gen:skill-docs
- bin/gstack-gemini-probe — auth/version/timeout helpers (mirrors
  bin/gstack-codex-probe)

Triggers: "gemini review", "gemini challenge", "ask gemini",
"consult gemini", "second opinion gemini".

Voice aliases: "ask gemini", "google second opinion", "gem in eye".

Claude-Session: 308270c8-8e03-4d4c-aeb3-8500e7af43d8
/gstack-upgrade hard-resets the current branch to origin/main, which silently
discards customization commits when run from the swxtch branch. This wrapper
keeps main as a pure upstream mirror, runs ./setup + migrations, then rebases
swxtch on top.

Survives running itself: re-execs from a temp copy so the main checkout that
removes its own (swxtch-only) file mid-run can't corrupt it. Idempotently
maintains a PATH symlink (~/.local/bin/gstack-safe-update -> in-repo script) so
a fresh clone is self-bootstrapping; refuses to clobber a foreign file there.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: 308270c8-8e03-4d4c-aeb3-8500e7af43d8
… rebase

The mirror-branch block ran ./setup before `git checkout $CUSTOM_BRANCH`, which
rewrote tracked SKILL.md files and left the mirror dirty — git then aborted the
checkout ("local changes would be overwritten") and stranded the run on `main`
with the custom branch un-rebased. Move ./setup + version migrations + markers
to run AFTER the rebase, on the custom branch, so the mirror stays pristine and
the generated files match the branch we actually end up on.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: 308270c8-8e03-4d4c-aeb3-8500e7af43d8
…ERM-ignoring CLIs

_gstack_{codex,gemini}_timeout_wrapper ran `timeout <dur> <cmd>`, which sends
SIGTERM only. The gemini node CLI ignores SIGTERM, so a hung review ran 553s
past a 330s cap and locked the calling agent (and even a manual kill of the
launcher left the --max-old-space-size child alive). Add --kill-after=10 so
timeout escalates to SIGKILL 10s after the initial TERM.

Verified: a TERM-ignoring child (`trap "" TERM; sleep 30`) under a 2s wrapper is
now reaped at ~12s (exit 137) instead of running to completion. Applied to both
codex and gemini probes (identical latent bug).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: 308270c8-8e03-4d4c-aeb3-8500e7af43d8
…w harness

Shared helper for /codex, /gemini and fix-and-ship cross-model reviews.
Gives reviewers the whole repo (not a diff) in a throwaway worktree off a
clean+pushed branch, and makes a hung/flaky reviewer safe:

- setsid + `timeout --kill-after` converts a lockup into a bounded exit
- stall watchdog kills early when output stops growing
- exit-code taxonomy OK/CLEAN/TIMEOUT/CRASH + one bounded retry
- PGIDs tracked in an flock'd FILE (survives $()/backgrounding/concurrency),
  cleanup kills every surviving group then removes the worktree on all paths

Tested: hang, stall, crash, retry, concurrent reviewers, in-group grandchild
reaping, and PGID-tracking-survives-subshell (the bug that nullified cleanup).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: 308270c8-8e03-4d4c-aeb3-8500e7af43d8
Wire the cross-model review skills to the gstack-review-sandbox harness so
reviewers see the whole repo (not a bare diff) — what stops the confident-wrong
"missing/breaking/no-default" false positives.

- gemini: add a PREFERRED full-context path to Review + Challenge modes — run
  tool-enabled (-y) over the whole repo + web inside a throwaway worktree.
  Gemini's --approval-mode plan disables tools, so full context needs -y; AND
  GEMINI_CLI_TRUST_WORKSPACE=true (a fresh worktree is "untrusted", where gemini
  silently downgrades -y to approval-prompt and loses tool access — caught in
  smoke: without it gemini returns empty → harness reports CRASH). The worktree
  + timeout + cleanup trap make the tool-enabled mode safe. Diff-only plan-mode
  path kept as fallback for dirty/unpushed trees. TIMEOUT/CRASH = coverage gap,
  never a clean pass.
- codex: note it already reads the whole repo (-s read-only) and can run via
  the shared harness for timeout-robust, clean-snapshot review.

tmpl-only (generated SKILL.md regenerates via ./setup on landing per gstack
discipline). Pairs with the gstack-review-sandbox helper.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: 308270c8-8e03-4d4c-aeb3-8500e7af43d8
…an/gstack

gstack-update-check hard-defaulted its upgrade source to garrytan/gstack@main,
so every fork user gets upgrade prompts (and SHA resolution) computed against
the public upstream instead of this fork's swxtch branch. Silent only while the
two happen to match versions; diverges the moment swxtch pins or holds back.

Point REMOTE_URL/REMOTE_REPO and the ls-remote SHA path at swxtchio/gstch@swxtch.
GSTACK_REMOTE_URL/REPO env overrides still honored.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@augmentcode

augmentcode Bot commented Jun 17, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Point gstack-update-check at this fork (swxtchio/gstack) on the swxtch branch instead of upstream garrytan/gstack@main.
Changes: Update the default VERSION URL, default git remote, and the SHA-pinned ls-remote/raw URL path to use swxtch.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread bin/gstack-update-check
_REMOTE_SHA="$(echo "$_LSR_LINE" | awk '{print $1}')"
if echo "$_REMOTE_SHA" | grep -qE '^[0-9a-f]{40}$'; then
_SHA_URL="https://raw.githubusercontent.com/garrytan/gstack/${_REMOTE_SHA}/VERSION"
_SHA_URL="https://raw.githubusercontent.com/swxtchio/gstack/${_REMOTE_SHA}/VERSION"

@augmentcode augmentcode Bot Jun 17, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_SHA_URL is hard-coded to swxtchio/gstack, so if someone overrides GSTACK_REMOTE_REPO (without also setting GSTACK_REMOTE_URL) the SHA-pinned fetch can consult the wrong repo (or fail) and make the update check inconsistent with the override. Other locations where this applies: bin/gstack-update-check:197.

Severity: medium

Other Locations
  • bin/gstack-update-check:197

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

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.

2 participants