@link-assistant/hive-mind 1.11.1 → 1.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @link-assistant/hive-mind
2
2
 
3
+ ## 1.11.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 8ee116a: fix: detect "command not found" errors to prevent false success
8
+
9
+ When the `claude` CLI command is not found (not installed or not in PATH), the tool was incorrectly reporting "Claude command completed" instead of detecting the failure. This fix adds "not found" to the stderr error detection pattern to properly detect when commands fail to start.
10
+
3
11
  ## 1.11.1
4
12
 
5
13
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@link-assistant/hive-mind",
3
- "version": "1.11.1",
3
+ "version": "1.11.2",
4
4
  "description": "AI-powered issue solver and hive mind for collaborative problem solving",
5
5
  "main": "src/hive.mjs",
6
6
  "type": "module",
@@ -1095,7 +1095,9 @@ export const executeClaudeCommand = async params => {
1095
1095
  // Example: "⚠️ [BashTool] Pre-flight check is taking longer than expected. Run with ANTHROPIC_LOG=debug to check for failed or slow API requests."
1096
1096
  // Even though this contains the word "failed", it's a warning, not an error
1097
1097
  const isWarning = trimmed.startsWith('⚠️') || trimmed.startsWith('⚠');
1098
- if (trimmed && !isWarning && (trimmed.includes('Error:') || trimmed.includes('error') || trimmed.includes('failed'))) {
1098
+ // Issue #1165: Also detect "command not found" errors (e.g., "/bin/sh: 1: claude: not found")
1099
+ // These indicate the Claude CLI is not installed or not in PATH
1100
+ if (trimmed && !isWarning && (trimmed.includes('Error:') || trimmed.includes('error') || trimmed.includes('failed') || trimmed.includes('not found'))) {
1099
1101
  stderrErrors.push(trimmed);
1100
1102
  }
1101
1103
  }
@@ -1108,6 +1110,23 @@ export const executeClaudeCommand = async params => {
1108
1110
  }
1109
1111
  }
1110
1112
 
1113
+ // Issue #1165: Check actual exit code from command result for more reliable detection
1114
+ // The .stream() method may not emit 'exit' chunks, but the command object still tracks the exit code
1115
+ // Exit code 127 is the standard Unix convention for "command not found"
1116
+ if (execCommand.result && typeof execCommand.result.code === 'number') {
1117
+ const resultExitCode = execCommand.result.code;
1118
+ if (exitCode === 0 && resultExitCode !== 0) {
1119
+ exitCode = resultExitCode;
1120
+ await log(`⚠️ Updated exit code from command result: ${resultExitCode}`, { verbose: true });
1121
+ }
1122
+ // Specifically detect "command not found" via exit code 127
1123
+ if (resultExitCode === 127 && !commandFailed) {
1124
+ commandFailed = true;
1125
+ await log(`\n❌ Command not found (exit code 127) - "${claudePath}" is not installed or not in PATH`, { level: 'error' });
1126
+ await log(' Please ensure Claude CLI is installed: npm install -g @anthropic-ai/claude-code', { level: 'error' });
1127
+ }
1128
+ }
1129
+
1111
1130
  // Flush any remaining queued comments from interactive mode
1112
1131
  if (interactiveHandler) {
1113
1132
  try {