@link-assistant/hive-mind 1.25.1 → 1.25.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,17 @@
1
1
  # @link-assistant/hive-mind
2
2
 
3
+ ## 1.25.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 0453550: feat: show all limits even when Claude authentication is expired (Issue #1343)
8
+
9
+ Previously, when Claude authentication expired, the `/limits` command would fail completely and show no information at all.
10
+
11
+ Now the command gracefully handles Claude auth failures:
12
+ - The error message (e.g., "Claude authentication expired. Please use /solve or /hive commands to trigger re-authentication of Claude.") is shown inline in the Claude limits sections
13
+ - All other limits sections (CPU, RAM, Disk space, GitHub API) continue to display normally
14
+
3
15
  ## 1.25.1
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -164,12 +164,29 @@ gh-setup-git-identity
164
164
  # Authenticate with Claude
165
165
  claude
166
166
 
167
+ # Optionally set configuration like this:
168
+ # Use /config command and set:
169
+ # Reduce motion true # Will save your ssh trafic, and make Claude Code more responsive (less latency)
170
+ # Thinking mode false # Anthropic models perform better and cheaper without thinking
171
+ # Model haiku # chepear for connection testing manually
172
+ # Claude in Chrome enabled by default false # No need for Chrome support on server
173
+
174
+ # Optionally test Claude connection
175
+ claude -p hi --model haiku
176
+
177
+ # You might need to update hive-mind and agent to latest versions:
178
+ bun install -g @link-assistant/hive-mind
179
+ bun install -g @link-assistant/agent
180
+
167
181
  # Now you can use hive and solve commands
168
182
  solve https://github.com/owner/repo/issues/123
169
183
 
170
184
  # Or you can run telegram bot:
171
185
 
172
- # Run an to main process
186
+ # Exit from additional bash session
187
+ exit
188
+
189
+ # Attach to main bash process
173
190
  docker attach hive-mind
174
191
 
175
192
  # Run bot here
@@ -187,6 +204,44 @@ docker attach hive-mind
187
204
 
188
205
  See [docs/DOCKER.md](./docs/DOCKER.md) for advanced Docker usage.
189
206
 
207
+ #### Stoping and removing docker container
208
+
209
+ ```
210
+ # Attach to main docker process to stop the container
211
+ docker attach hive-mind
212
+
213
+ ^C # stop the telegram bot
214
+
215
+ exit # exit/stop the container
216
+
217
+ docker ps -a # show list of docker containers
218
+ # CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
219
+ # fd0fd4470ec3 konard/hive-mind:latest "/bin/bash" 5 days ago Exited (130) 16 seconds ago hive-mind
220
+
221
+
222
+ df -h # check disk space
223
+ # Filesystem Size Used Avail Use% Mounted on
224
+ # tmpfs 1.2G 1.1M 1.2G 1% /run
225
+ # /dev/sda1 96G 87G 9.8G 90% /
226
+ # tmpfs 5.9G 0 5.9G 0% /dev/shm
227
+ # tmpfs 5.0M 0 5.0M 0% /run/lock
228
+ # /dev/sda16 881M 117M 703M 15% /boot
229
+ # /dev/sda15 105M 6.2M 99M 6% /boot/efi
230
+ # tmpfs 1.2G 12K 1.2G 1% /run/user/0
231
+
232
+ docker rm hive-mind # remove docker container frees space used by the container, does not delete image
233
+
234
+ df -h # check disk space (to confirm space is freed)
235
+ # Filesystem Size Used Avail Use% Mounted on
236
+ # tmpfs 1.2G 1.1M 1.2G 1% /run
237
+ # /dev/sda1 96G 26G 71G 27% /
238
+ # tmpfs 5.9G 0 5.9G 0% /dev/shm
239
+ # tmpfs 5.0M 0 5.0M 0% /run/lock
240
+ # /dev/sda16 881M 117M 703M 15% /boot
241
+ # /dev/sda15 105M 6.2M 99M 6% /boot/efi
242
+ # tmpfs 1.2G 12K 1.2G 1% /run/user/0
243
+ ```
244
+
190
245
  ### Helm Installation (Kubernetes)
191
246
 
192
247
  Deploy Hive Mind on Kubernetes using Helm:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@link-assistant/hive-mind",
3
- "version": "1.25.1",
3
+ "version": "1.25.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",
@@ -694,15 +694,16 @@ export function calculateTimePassedPercentage(resetsAt, periodHours) {
694
694
  * Format Claude usage data into a Telegram-friendly message
695
695
  * Shows threshold markers in progress bars to indicate where queue behavior changes.
696
696
  *
697
- * @param {Object} usage - The usage object from getClaudeUsageLimits
697
+ * @param {Object|null} usage - The usage object from getClaudeUsageLimits, or null if unavailable
698
698
  * @param {Object} diskSpace - Optional disk space info from getDiskSpaceInfo
699
699
  * @param {Object} githubRateLimit - Optional GitHub rate limit info from getGitHubRateLimits
700
700
  * @param {Object} cpuLoad - Optional CPU load info from getCpuLoadInfo
701
701
  * @param {Object} memory - Optional memory info from getMemoryInfo
702
+ * @param {string|null} claudeError - Optional error message to show in Claude sections (e.g., auth expired)
702
703
  * @returns {string} Formatted message
703
704
  * @see https://github.com/link-assistant/hive-mind/issues/1242
704
705
  */
705
- export function formatUsageMessage(usage, diskSpace = null, githubRateLimit = null, cpuLoad = null, memory = null) {
706
+ export function formatUsageMessage(usage, diskSpace = null, githubRateLimit = null, cpuLoad = null, memory = null, claudeError = null) {
706
707
  // Use code block for monospace font to align progress bars properly
707
708
  let message = '```\n';
708
709
 
@@ -761,10 +762,18 @@ export function formatUsageMessage(usage, diskSpace = null, githubRateLimit = nu
761
762
  message += '\n';
762
763
  }
763
764
 
765
+ // Claude limits section
766
+ // When there's an error (e.g., auth expired), show it once here instead of repeating in each subsection
767
+ if (claudeError) {
768
+ message += `Claude limits\n${claudeError}\n\n`;
769
+ }
770
+
764
771
  // Claude 5 hour session (five_hour)
765
772
  // Threshold: One-at-a-time mode when usage >= 65%
766
773
  message += 'Claude 5 hour session\n';
767
- if (usage.currentSession.percentage !== null) {
774
+ if (claudeError) {
775
+ // Error already shown above; skip subsection content
776
+ } else if (usage && usage.currentSession.percentage !== null) {
768
777
  // Add time passed progress bar first (no threshold marker for time)
769
778
  const timePassed = calculateTimePassedPercentage(usage.currentSession.resetsAt, 5);
770
779
  if (timePassed !== null) {
@@ -796,7 +805,9 @@ export function formatUsageMessage(usage, diskSpace = null, githubRateLimit = nu
796
805
  // Current week (all models / seven_day)
797
806
  // Threshold: One-at-a-time mode when usage >= 97%
798
807
  message += 'Current week (all models)\n';
799
- if (usage.allModels.percentage !== null) {
808
+ if (claudeError) {
809
+ // Error already shown above; skip subsection content
810
+ } else if (usage && usage.allModels.percentage !== null) {
800
811
  // Add time passed progress bar first (no threshold marker for time)
801
812
  const timePassed = calculateTimePassedPercentage(usage.allModels.resetsAt, 168);
802
813
  if (timePassed !== null) {
@@ -828,7 +839,9 @@ export function formatUsageMessage(usage, diskSpace = null, githubRateLimit = nu
828
839
  // Current week (Sonnet only / seven_day_sonnet)
829
840
  // Threshold: One-at-a-time mode when usage >= 97% (same as all models)
830
841
  message += 'Current week (Sonnet only)\n';
831
- if (usage.sonnetOnly.percentage !== null) {
842
+ if (claudeError) {
843
+ // Error already shown above; skip subsection content
844
+ } else if (usage && usage.sonnetOnly.percentage !== null) {
832
845
  // Add time passed progress bar first (no threshold marker for time)
833
846
  const timePassed = calculateTimePassedPercentage(usage.sonnetOnly.resetsAt, 168);
834
847
  if (timePassed !== null) {
@@ -780,14 +780,12 @@ bot.command('limits', async ctx => {
780
780
  // Get all limits using shared cache (3min for API, 2min for system)
781
781
  const limits = await getAllCachedLimits(VERBOSE);
782
782
 
783
- if (!limits.claude.success) {
784
- const escapedError = escapeMarkdownV2(limits.claude.error, { preserveCodeBlocks: true });
785
- await ctx.telegram.editMessageText(fetchingMessage.chat.id, fetchingMessage.message_id, undefined, `❌ ${escapedError}`, { parse_mode: 'MarkdownV2' });
786
- return;
787
- }
788
-
789
783
  // Format the message with usage limits and queue status
790
- let message = '📊 *Usage Limits*\n\n' + formatUsageMessage(limits.claude.usage, limits.disk.success ? limits.disk.diskSpace : null, limits.github.success ? limits.github.githubRateLimit : null, limits.cpu.success ? limits.cpu.cpuLoad : null, limits.memory.success ? limits.memory.memory : null);
784
+ // If Claude auth failed, pass the error to formatUsageMessage to show it in the Claude sections
785
+ // while still displaying all other limits sections (disk, GitHub, CPU, memory)
786
+ // See: https://github.com/link-assistant/hive-mind/issues/1343
787
+ const claudeError = limits.claude.success ? null : limits.claude.error;
788
+ let message = '📊 *Usage Limits*\n\n' + formatUsageMessage(limits.claude.success ? limits.claude.usage : null, limits.disk.success ? limits.disk.diskSpace : null, limits.github.success ? limits.github.githubRateLimit : null, limits.cpu.success ? limits.cpu.cpuLoad : null, limits.memory.success ? limits.memory.memory : null, claudeError);
791
789
  const solveQueue = getSolveQueue({ verbose: VERBOSE });
792
790
  // Insert per-queue status into the code block
793
791
  // Shows each queue (claude, agent) with pending/processing counts