Skip to content

gstack-brain-context-load treats gbrain as missing when availability probe execs command directly #1559

@jbetala7

Description

@jbetala7

Observed problem

bin/gstack-brain-context-load.ts checks whether vector/list queries can run with:

execFileSync("command", ["-v", "gbrain"], { stdio: "ignore" });

command is a shell builtin, not a standalone executable on normal POSIX installs. When no executable named command exists, this throws before gbrain is tried, so the helper treats gbrain as missing and skips all vector/list context queries.

Current behavior on upstream main

Fresh origin/main at 33cb4715ef0bc9be31a29bdf1d9655482a617ee6 still has this check in bin/gstack-brain-context-load.ts. Running:

bun run bin/gstack-brain-context-load.ts --repo garrytan-gstack --explain --quiet

prints three SKIP lines with gbrain CLI missing. The existing graceful-absence test accepts either OK or SKIP, so it does not prove that a gbrain binary on PATH is actually used.

Expected behavior

When gbrain is available on PATH, gstack-brain-context-load should run its vector/list queries instead of reporting gbrain CLI missing.

Duplicate searches performed

I searched open issues and PRs for:

  • gstack-brain-context-load
  • brain-context-load
  • context load gbrain
  • gbrain CLI missing
  • command -v gbrain

Related but non-duplicate results:

I found no open PR or issue for this specific context-load availability path.

Candidate fix shape

Probe the actual gbrain executable directly, for example with a cheap gbrain --version call, and add a regression test that places a fake gbrain on PATH and verifies gstack-brain-context-load reports OK/renders query output rather than SKIP (gbrain CLI missing).

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