fix(setup-gbrain): never ask the provider question inside /setup-gbrain

Invoking /setup-gbrain IS the provider choice. Step 1.7 now records
'select gbrain' best-effort and proceeds straight to setup; the offer
ceremony is reserved for entry points where no provider was named. On
machines where the code-intelligence CLI exists, the offer:true path
was hijacking setup into the provider ceremony and the E2E child never
reached MCP registration.
This commit is contained in:
Garry Tan
2026-08-15 00:09:51 -07:00
parent 9889f27491
commit 7494f15541
2 changed files with 20 additions and 8 deletions
+10 -4
View File
@@ -921,15 +921,21 @@ Step 1.5 — fall through to Step 2 (where `no-cli` triggers Step 3 install and
## Step 1.7: Code-intelligence provider choice (Step 0 of indexing) ## Step 1.7: Code-intelligence provider choice (Step 0 of indexing)
gbrain is one of THREE code-intelligence providers gstack can use; the offer You are INSIDE /setup-gbrain: the user asked for gbrain by name, so the
gate decides whether this repo is even worth indexing: provider question is already answered. NEVER ask it here, and never let this
step delay or derail the actual setup. Record the choice best-effort, then
continue immediately with Step 2:
```bash ```bash
[ -f ~/.claude/skills/gstack/bin/gstack-code-intelligence ] \ [ -f ~/.claude/skills/gstack/bin/gstack-code-intelligence ] \
&& bun ~/.claude/skills/gstack/bin/gstack-code-intelligence suggest --json \ && bun ~/.claude/skills/gstack/bin/gstack-code-intelligence select gbrain 2>/dev/null \
|| echo '{"offer": false, "reason": "bin-absent"}' || true
``` ```
The offer ceremony below applies ONLY when this skill is reached from another
entry point where no provider was named (a routing skill exploring indexing
options). Even then:
- `"offer": false` with reason `bin-absent` → the installed gstack predates - `"offer": false` with reason `bin-absent` → the installed gstack predates
the code-intelligence CLI. Skip this step entirely and continue with the 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 skill — the user asked for gbrain, so set up gbrain. Never block setup on
+10 -4
View File
@@ -163,15 +163,21 @@ Step 1.5 — fall through to Step 2 (where `no-cli` triggers Step 3 install and
## Step 1.7: Code-intelligence provider choice (Step 0 of indexing) ## Step 1.7: Code-intelligence provider choice (Step 0 of indexing)
gbrain is one of THREE code-intelligence providers gstack can use; the offer You are INSIDE /setup-gbrain: the user asked for gbrain by name, so the
gate decides whether this repo is even worth indexing: provider question is already answered. NEVER ask it here, and never let this
step delay or derail the actual setup. Record the choice best-effort, then
continue immediately with Step 2:
```bash ```bash
[ -f ~/.claude/skills/gstack/bin/gstack-code-intelligence ] \ [ -f ~/.claude/skills/gstack/bin/gstack-code-intelligence ] \
&& bun ~/.claude/skills/gstack/bin/gstack-code-intelligence suggest --json \ && bun ~/.claude/skills/gstack/bin/gstack-code-intelligence select gbrain 2>/dev/null \
|| echo '{"offer": false, "reason": "bin-absent"}' || true
``` ```
The offer ceremony below applies ONLY when this skill is reached from another
entry point where no provider was named (a routing skill exploring indexing
options). Even then:
- `"offer": false` with reason `bin-absent` → the installed gstack predates - `"offer": false` with reason `bin-absent` → the installed gstack predates
the code-intelligence CLI. Skip this step entirely and continue with the 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 skill — the user asked for gbrain, so set up gbrain. Never block setup on