@link-assistant/hive-mind 1.11.0 → 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,27 @@
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
+
11
+ ## 1.11.1
12
+
13
+ ### Patch Changes
14
+
15
+ - de2cc28: Use .gitkeep by default for --tool agent/opencode/codex instead of CLAUDE.md
16
+
17
+ When using non-Claude tools (agent, opencode, codex), the system now defaults to creating a `.gitkeep` file for task details instead of `CLAUDE.md`. This prevents pollution of CLAUDE.md, which has special meaning for Claude Code as a project-level instruction file.
18
+
19
+ **Tool-Specific Defaults:**
20
+ - `--tool claude`: defaults to `--claude-file` (existing behavior)
21
+ - `--tool agent/opencode/codex`: defaults to `--gitkeep-file`
22
+
23
+ Users can still explicitly override defaults with `--claude-file` or `--gitkeep-file` flags regardless of the selected tool.
24
+
3
25
  ## 1.11.0
4
26
 
5
27
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@link-assistant/hive-mind",
3
- "version": "1.11.0",
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 {
@@ -130,12 +130,12 @@ export const createYargsConfig = yargsInstance => {
130
130
  })
131
131
  .option('claude-file', {
132
132
  type: 'boolean',
133
- description: 'Create CLAUDE.md file for task details (default, mutually exclusive with --gitkeep-file)',
133
+ description: 'Create CLAUDE.md file for task details (default for --tool claude, mutually exclusive with --gitkeep-file)',
134
134
  default: true,
135
135
  })
136
136
  .option('gitkeep-file', {
137
137
  type: 'boolean',
138
- description: 'Create .gitkeep file instead of CLAUDE.md (mutually exclusive with --claude-file)',
138
+ description: 'Create .gitkeep file instead of CLAUDE.md (default for --tool agent/opencode/codex, mutually exclusive with --claude-file)',
139
139
  default: false,
140
140
  })
141
141
  .option('auto-gitkeep-file', {
@@ -477,6 +477,20 @@ export const parseArguments = async (yargs, hideBin) => {
477
477
  argv.model = 'grok-code';
478
478
  }
479
479
 
480
+ // Tool-specific defaults for --claude-file and --gitkeep-file
481
+ // For non-Claude tools, use .gitkeep by default to avoid polluting CLAUDE.md
482
+ // (CLAUDE.md has special meaning for Claude Code as a project-level instruction file)
483
+ // See: https://github.com/link-assistant/hive-mind/issues/1158
484
+ const claudeFileExplicitlyProvided = rawArgs.includes('--claude-file') || rawArgs.includes('--no-claude-file');
485
+ const gitkeepFileExplicitlyProvided = rawArgs.includes('--gitkeep-file') || rawArgs.includes('--no-gitkeep-file');
486
+
487
+ if (argv.tool !== 'claude' && !claudeFileExplicitlyProvided && !gitkeepFileExplicitlyProvided) {
488
+ // User did not explicitly provide either option, so use the correct defaults for non-Claude tools
489
+ // Non-Claude tools (agent, opencode, codex) should use .gitkeep by default
490
+ argv.claudeFile = false;
491
+ argv.gitkeepFile = true;
492
+ }
493
+
480
494
  // Validate mutual exclusivity of --claude-file and --gitkeep-file
481
495
  // Check if both are explicitly enabled (user passed both --claude-file and --gitkeep-file)
482
496
  if (argv.claudeFile && argv.gitkeepFile) {