Skip to content

/sync-gbrain code stage fails on managed gbrain (>= 0.51): gbrain sync needs --no-pull #2985

Closed

Description

@michael-sumner

Summary

After gbrain's managed writer mode is activated (gbrain >= 0.51, gbrain sources writer activate), gbrain sync refuses to run without --no-pull. gstack-gbrain-sync.ts builds the code-stage command without that flag, so /sync-gbrain fails every time on managed brains:

ERR   code   gbrain sync --strategy code --source gstack-code-<repo>-<hash> exited 1

Running the same command directly shows the reason:

Managed sync requires --no-pull; Git pull/rebase needs an explicit drained maintenance window.

Adding --no-pull fixes it (Already up to date., and the stage goes back to OK).

Environment

  • gstack 1.91.2.0 (fresh clone + ./setup)
  • gbrain 0.59.0.0, Postgres engine, local-stdio MCP mode, macOS arm64
  • All sources claimed and writer status showing enabled: true

Where

bin/gstack-gbrain-sync.ts, in the code stage:

const walkArgs = ["sync", "--strategy", "code", "--source", sourceId];
if (args.mode === "full") walkArgs.push("--full", "--yes");

Suggested fix

The code stage indexes the user's working checkout, and gstack should never pull or rebase it anyway, so passing --no-pull unconditionally looks safe:

-  const walkArgs = ["sync", "--strategy", "code", "--source", sourceId];
+  // --no-pull: managed writer mode (gbrain >= 0.51) refuses sync without it,
+  // and the user owns pulls of their own checkout.
+  const walkArgs = ["sync", "--strategy", "code", "--source", sourceId, "--no-pull"];

If older gbrain versions reject the flag, it could be gated on gbrain sources writer status --json → enabled: true. On 0.59 the flag is accepted in both modes.

I've applied this locally and the orchestrator returns 3 ok, 0 error again. The patch is lost on the next gstack upgrade, which is why I'm reporting it here.

Related but different: #2920 (a "managed canonical worktree" error with writer mode disabled).

Activity

  1. capy-ai commented on Oct 2, 2026

    @capy-ai
    Contributor

    Fixed in v1.91.13.0 (#3013, merged as f30b7b7): the code-stage sync always passes --no-pull and never retries without it. Run /gstack-upgrade, then start a new Claude Code session. Thanks for the report. Reopen if you still see it after upgrading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions