From 11b3e517d7d814a6ce8998f9623d2f94ee74129d Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Fri, 14 Aug 2026 21:22:37 -0700 Subject: [PATCH] fix(setup-gbrain): the code-intelligence offer gate skips when the bin is absent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new Step 1.7 told the agent to run gstack-code-intelligence before the path pick — on installs predating the CLI (and hermetic E2E children) the bin doesn't exist and setup derailed before doing any setup. The gate now probes for the bin and reports offer:false reason:bin-absent, with explicit instructions to proceed: the user asked for gbrain, so set up gbrain. Never block setup on an optional gate. --- setup-gbrain/SKILL.md | 9 ++++++++- setup-gbrain/SKILL.md.tmpl | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/setup-gbrain/SKILL.md b/setup-gbrain/SKILL.md index 9fdf8118e..a019d912a 100644 --- a/setup-gbrain/SKILL.md +++ b/setup-gbrain/SKILL.md @@ -925,9 +925,16 @@ gbrain is one of THREE code-intelligence providers gstack can use; the offer gate decides whether this repo is even worth indexing: ```bash -bun ~/.claude/skills/gstack/bin/gstack-code-intelligence suggest --json +[ -f ~/.claude/skills/gstack/bin/gstack-code-intelligence ] \ + && bun ~/.claude/skills/gstack/bin/gstack-code-intelligence suggest --json \ + || echo '{"offer": false, "reason": "bin-absent"}' ``` +- `"offer": false` with reason `bin-absent` → the installed gstack predates + the code-intelligence CLI. Skip this step entirely and continue with the + skill — the user asked for gbrain, so set up gbrain. Never block setup on + a missing optional gate. + - `"offer": false` with reason `small-repo` → grep is already fast here; say so in one line and continue with this skill only if the user asked for gbrain by name. diff --git a/setup-gbrain/SKILL.md.tmpl b/setup-gbrain/SKILL.md.tmpl index 83ac8575e..dc7f53183 100644 --- a/setup-gbrain/SKILL.md.tmpl +++ b/setup-gbrain/SKILL.md.tmpl @@ -167,9 +167,16 @@ gbrain is one of THREE code-intelligence providers gstack can use; the offer gate decides whether this repo is even worth indexing: ```bash -bun ~/.claude/skills/gstack/bin/gstack-code-intelligence suggest --json +[ -f ~/.claude/skills/gstack/bin/gstack-code-intelligence ] \ + && bun ~/.claude/skills/gstack/bin/gstack-code-intelligence suggest --json \ + || echo '{"offer": false, "reason": "bin-absent"}' ``` +- `"offer": false` with reason `bin-absent` → the installed gstack predates + the code-intelligence CLI. Skip this step entirely and continue with the + skill — the user asked for gbrain, so set up gbrain. Never block setup on + a missing optional gate. + - `"offer": false` with reason `small-repo` → grep is already fast here; say so in one line and continue with this skill only if the user asked for gbrain by name.