mirror of
https://github.com/garrytan/gstack.git
synced 2026-06-24 10:39:57 +02:00
fix(brain-context-load): probe gbrain via execFile, not shell builtin (#1559)
gbrainAvailable() used `execFileSync("command", ["-v", "gbrain"])`,
which fails in any environment where the `command` builtin isn't on
the spawned process's PATH (most non-interactive shells). The probe
then reported gbrain as missing even when it was installed, and
context-load silently skipped vector/list queries.
Fix: probe `gbrain --version` directly with a 500ms timeout (matching
the rest of the file's MCP_TIMEOUT_MS). Same semantics, works
everywhere execFile works.
Contributed by @jbetala7 via #1560. Closes #1559.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -192,7 +192,10 @@ function resolveSkillFile(args: CliArgs): string | null {
|
||||
|
||||
function gbrainAvailable(): boolean {
|
||||
try {
|
||||
execFileSync("command", ["-v", "gbrain"], { stdio: "ignore" });
|
||||
execFileSync("gbrain", ["--version"], {
|
||||
stdio: "ignore",
|
||||
timeout: MCP_TIMEOUT_MS,
|
||||
});
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user