@link-assistant/hive-mind 1.54.1 → 1.54.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,12 @@
1
1
  # @link-assistant/hive-mind
2
2
 
3
+ ## 1.54.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 9d4e473: Cap `/limits` CPU cores display at available CPU count when load average demand exceeds capacity.
8
+ - ea0b9f5: Use Anthropic's native Claude Code installer in Docker images so the CLI binary is installed even when Bun blocks dependency postinstall scripts.
9
+
3
10
  ## 1.54.1
4
11
 
5
12
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@link-assistant/hive-mind",
3
- "version": "1.54.1",
3
+ "version": "1.54.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",
@@ -13,7 +13,7 @@
13
13
  "hive-telegram-bot": "./src/telegram-bot.mjs"
14
14
  },
15
15
  "scripts": {
16
- "test": "node tests/solve-queue.test.mjs && node tests/limits-display.test.mjs && node tests/test-usage-limit.mjs && node tests/test-issue-1616-pr-issue-link-preservation.mjs && node tests/test-telegram-message-filters.mjs && node tests/test-telegram-bot-command-aliases.mjs && node tests/test-solve-queue-command.mjs && node tests/test-queue-display-1267.mjs && node tests/test-telegram-bot-launcher.mjs",
16
+ "test": "node tests/solve-queue.test.mjs && node tests/limits-display.test.mjs && node tests/test-usage-limit.mjs && node tests/test-claude-code-install-method.mjs && node tests/test-issue-1616-pr-issue-link-preservation.mjs && node tests/test-telegram-message-filters.mjs && node tests/test-telegram-bot-command-aliases.mjs && node tests/test-solve-queue-command.mjs && node tests/test-queue-display-1267.mjs && node tests/test-telegram-bot-launcher.mjs",
17
17
  "test:queue": "node tests/solve-queue.test.mjs",
18
18
  "test:limits-display": "node tests/limits-display.test.mjs",
19
19
  "test:usage-limit": "node tests/test-usage-limit.mjs",
@@ -297,6 +297,15 @@ function formatBytesRange(usedBytes, totalBytes) {
297
297
  return `${usedValue.toFixed(decimals)}/${totalValue.toFixed(decimals)} ${sizes[i]} used`;
298
298
  }
299
299
 
300
+ function formatRoundedNumber(value, decimals = 2) {
301
+ return parseFloat(value.toFixed(decimals));
302
+ }
303
+
304
+ function getDisplayCpuCoresUsed(loadAvg5, cpuCount) {
305
+ const boundedLoad = Math.min(Math.max(loadAvg5, 0), cpuCount);
306
+ return formatRoundedNumber(boundedLoad);
307
+ }
308
+
300
309
  /**
301
310
  * Get GitHub API rate limits by calling gh api rate_limit
302
311
  * Returns rate limit info for core, search, graphql, and other resources
@@ -428,6 +437,7 @@ export async function getCpuLoadInfo(verbose = false) {
428
437
  // Load average of 1.0 per CPU = 100% utilization
429
438
  // Using 5m average for consistency with solve queue (see issue #1137)
430
439
  const usagePercentage = Math.min(100, Math.round((loadAvg5 / cpuCount) * 100));
440
+ const usedCpuCores = getDisplayCpuCoresUsed(loadAvg5, cpuCount);
431
441
 
432
442
  if (verbose) {
433
443
  console.log(`[VERBOSE] /limits CPU load: ${loadAvg1.toFixed(2)} (1m), ${loadAvg5.toFixed(2)} (5m), ${loadAvg15.toFixed(2)} (15m), ${cpuCount} CPUs, ${usagePercentage}% used`);
@@ -441,6 +451,7 @@ export async function getCpuLoadInfo(verbose = false) {
441
451
  loadAvg15,
442
452
  cpuCount,
443
453
  usagePercentage,
454
+ usedCpuCores,
444
455
  },
445
456
  };
446
457
  } catch (error) {
@@ -1027,9 +1038,14 @@ export function formatUsageMessage(usage, diskSpace = null, githubRateLimit = nu
1027
1038
  // See: https://github.com/link-assistant/hive-mind/issues/1267
1028
1039
  const suffix = cpuLoad.usagePercentage >= DISPLAY_THRESHOLDS.CPU ? ' ⚠️' : ' used';
1029
1040
  section += `${usedBar} ${cpuLoad.usagePercentage}%${suffix}\n`;
1030
- // Show cores used based on 5m load average (e.g., "0.04/6 CPU cores used" or "3/6 CPU cores used")
1031
- // Use parseFloat to strip unnecessary trailing zeros (3.00 -> 3, 0.10 -> 0.1, 0.04 -> 0.04)
1032
- section += `${parseFloat(cpuLoad.loadAvg5.toFixed(2))}/${cpuLoad.cpuCount} CPU cores\n`;
1041
+ // Linux load average is demand, not bounded CPU time. Keep the cores-used
1042
+ // display within CPU capacity and show raw load average only when saturated.
1043
+ const usedCpuCores = cpuLoad.usedCpuCores ?? getDisplayCpuCoresUsed(cpuLoad.loadAvg5, cpuLoad.cpuCount);
1044
+ let cpuCoresLine = `${formatRoundedNumber(usedCpuCores)}/${cpuLoad.cpuCount} CPU cores used`;
1045
+ if (cpuLoad.loadAvg5 > cpuLoad.cpuCount) {
1046
+ cpuCoresLine += ` (5m load avg ${formatRoundedNumber(cpuLoad.loadAvg5)})`;
1047
+ }
1048
+ section += `${cpuCoresLine}\n`;
1033
1049
  sections.push(section);
1034
1050
  }
1035
1051