From 2a444acf1d3cde8f1bb35f84339527fcc3ab0f74 Mon Sep 17 00:00:00 2001 From: abhigyanpatwari Date: Thu, 26 Feb 2026 18:08:32 +0530 Subject: [PATCH] fix(plugin): hook logic bug and version mismatch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix hook exit status check: || → && so failed augment errors don't get injected into Claude's context as graph results - Add exit status check to npx fallback (same bug) - Update plugin version from 1.2.11 to 1.3.3 in both marketplace.json and plugin.json Co-Authored-By: Claude Opus 4.6 --- .claude-plugin/marketplace.json | 2 +- gitnexus-claude-plugin/.claude-plugin/plugin.json | 2 +- gitnexus-claude-plugin/hooks/gitnexus-hook.js | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index eeabc24d3..719473def 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -11,7 +11,7 @@ "plugins": [ { "name": "gitnexus", - "version": "1.2.11", + "version": "1.3.3", "source": "./gitnexus-claude-plugin", "description": "Code intelligence powered by a knowledge graph. Provides execution flow tracing, blast radius analysis, and augmented search across your codebase." } diff --git a/gitnexus-claude-plugin/.claude-plugin/plugin.json b/gitnexus-claude-plugin/.claude-plugin/plugin.json index 333a5c7eb..75eb93797 100644 --- a/gitnexus-claude-plugin/.claude-plugin/plugin.json +++ b/gitnexus-claude-plugin/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "gitnexus", "description": "Code intelligence powered by a knowledge graph. Provides execution flow tracing, blast radius analysis, and augmented search across your codebase.", - "version": "1.2.11", + "version": "1.3.3", "author": { "name": "GitNexus" }, diff --git a/gitnexus-claude-plugin/hooks/gitnexus-hook.js b/gitnexus-claude-plugin/hooks/gitnexus-hook.js index 53380806b..7b77e4c34 100644 --- a/gitnexus-claude-plugin/hooks/gitnexus-hook.js +++ b/gitnexus-claude-plugin/hooks/gitnexus-hook.js @@ -112,8 +112,8 @@ function main() { ['augment', pattern], { encoding: 'utf-8', timeout: 8000, cwd, stdio: ['pipe', 'pipe', 'pipe'] } ); - if (child.status === 0 || (child.stderr && child.stderr.trim())) { - result = child.stderr || ''; + if (child.status === 0 && child.stderr && child.stderr.trim()) { + result = child.stderr; } } catch { /* not on PATH */ } @@ -125,7 +125,9 @@ function main() { ['-y', 'gitnexus', 'augment', pattern], { encoding: 'utf-8', timeout: 15000, cwd, stdio: ['pipe', 'pipe', 'pipe'] } ); - result = child.stderr || ''; + if (child.status === 0 && child.stderr && child.stderr.trim()) { + result = child.stderr; + } } catch { /* graceful failure */ } }