gstack icon indicating copy to clipboard operation
gstack copied to clipboard

/setup-gbrain Step 7 sets wrong config key (gbrain_sync_mode); brain-sync reads artifacts_sync_mode → federation silently never runs

Open topcoder1 opened this issue 6 months ago • 1 comments

Bug

`/setup-gbrain` Step 7 ("Offer gstack-brain-sync + wire it into gbrain") writes:

```bash ~/.claude/skills/gstack/bin/gstack-config set gbrain_sync_mode artifacts-only ```

But `~/.claude/skills/gstack/bin/gstack-brain-sync` reads a different config key — `artifacts_sync_mode` (lines 73, 239, 337). The mismatch means:

  • User goes through `/setup-gbrain`, picks "yes, artifacts-only" at the federation prompt
  • gstack-config stores `gbrain_sync_mode=artifacts-only` ✅
  • `gstack-brain-sync` checks `artifacts_sync_mode` → not set → returns `off`
  • `--once` and preamble auto-syncs silently no-op
  • `--status` shows `mode: off`
  • ~/.gstack/ never gets pushed to the federated GitHub repo
  • Multi-Mac users never see each other's plans/retros/learnings

The federation prompt is acknowledged successfully and gives no error, but the underlying mechanism is dormant.

Repro

```bash /setup-gbrain # accept federation prompt with "yes, artifacts-only" ~/.claude/skills/gstack/bin/gstack-config get gbrain_sync_mode

→ artifacts-only

~/.claude/skills/gstack/bin/gstack-brain-sync --status

→ {"queue_depth":0,"last_push":"never","mode":"off"}

~/.claude/skills/gstack/bin/gstack-brain-sync --once

silently does nothing — no commit, no push

git -C ~/.gstack log --oneline

→ only the initial gstack-brain-init commit, no sync commits

```

Then:

```bash ~/.claude/skills/gstack/bin/gstack-config set artifacts_sync_mode artifacts-only ~/.claude/skills/gstack/bin/gstack-brain-sync --once

now pushes N file(s) successfully

```

Verified on

  • gstack v1.31.1.0 (current upstream HEAD as of 2026-05-11)
  • gbrain v0.32.0
  • macOS, PGLite engine, single-Mac install with federated GitHub repo target

Suggested fix

In `/setup-gbrain` Step 7, change the config-set line to `artifacts_sync_mode` (the key brain-sync actually reads). Optionally also leave `gbrain_sync_mode` for backward-compat with anything else that might check it. Or rename the read in brain-sync to match the skill's convention. Either way, the two should align.

Impact

Anyone who ran `/setup-gbrain` with the federation option enabled is currently NOT federating. They have a fully-configured ~/.gstack/.git pointing at their brain repo, an MCP-registered gbrain, and a CLAUDE.md note saying "Memory sync: artifacts-only" — but no actual data is leaving their machine. Multi-Mac federation is silently broken until they manually set the right key.

Discovered via diff between `gstack-config get gbrain_sync_mode` (returns artifacts-only) and `gstack-brain-sync --status` (returns mode:off) on a fresh setup.

topcoder1 avatar May 12 '26 01:05 topcoder1

Already fixed in HEAD as part of the v1.27.0.0 rename. Verified just now on main:

  • setup-gbrain/SKILL.md.tmpl:479 writes the correct artifacts_sync_mode key.
  • bin/gstack-brain-sync reads artifacts_sync_mode at lines 73, 239, 337.
  • bin/gstack-config:63 confirms the rename: # ─── Artifacts sync (renamed from gbrain_sync_mode in v1.27.0.0) ─────
  • gstack-upgrade/migrations/v1.27.0.0.sh:255-264 migrates legacy gbrain_sync_mode → artifacts_sync_mode in ~/.gstack/config.yaml automatically on upgrade.

If you ran /setup-gbrain against v1.31.1.0 (the version in this report) and still see the old key, gstack-upgrade should rewrite it. If it doesn't, gstack-config set artifacts_sync_mode <mode> is the manual fix and gstack-brain-sync --once will start federating immediately.

Closing as fixed. Thanks for the precise repro — those gstack-config get vs gstack-brain-sync --status diagnostics made this trivial to verify against current HEAD.

garrytan avatar May 14 '26 15:05 garrytan