@link-assistant/hive-mind 1.50.1 → 1.50.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,16 @@
1
1
  # @link-assistant/hive-mind
2
2
 
3
+ ## 1.50.2
4
+
5
+ ### Patch Changes
6
+
7
+ - f09dead: fix: always post GitHub comment when usage limit is reached in auto-restart mode (#1570)
8
+ - Fix silent waiting behavior in watchUntilMergeable() when usage limit is reached
9
+ - Previously the system would silently wait 40+ minutes without any user notification
10
+ - Now posts a GitHub comment to the PR using attachLogToGitHub() with usage limit details
11
+ - Comment includes reset time, session ID, and indicates auto-restart will resume automatically
12
+ - Log output now also shows the calculated resume time in UTC
13
+
3
14
  ## 1.50.1
4
15
 
5
16
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@link-assistant/hive-mind",
3
- "version": "1.50.1",
3
+ "version": "1.50.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",
@@ -1004,9 +1004,10 @@ Once the billing issue is resolved, you can re-run the CI checks or push a new c
1004
1004
 
1005
1005
  if (!toolResult.success) {
1006
1006
  // Issue #1356: Check for usage limit errors FIRST (most specific)
1007
- // When usage limit is reached, silently wait for limitResetTime + buffer + jitter,
1007
+ // When usage limit is reached, wait for limitResetTime + buffer + jitter,
1008
1008
  // then resume the session using --resume <sessionId> with a "Continue" prompt.
1009
- // No GitHub comment is posted only log output.
1009
+ // Issue #1570: Always post a GitHub comment to notify the user about the delay
1010
+ // and when exactly execution will be resumed, so the user doesn't think the process is stuck.
1010
1011
  if (isUsageLimitReached(toolResult)) {
1011
1012
  const resumeSessionId = toolResult.sessionId;
1012
1013
  const resetTime = toolResult.limitResetTime;
@@ -1018,17 +1019,70 @@ Once the billing issue is resolved, you can re-run the CI checks or push a new c
1018
1019
  const jitterSeconds = Math.round(jitterMs / 1000);
1019
1020
  const waitMinutes = Math.round(waitMs / 60000);
1020
1021
 
1022
+ // Issue #1570: Calculate the actual resume time for user display
1023
+ const resumeDate = new Date(Date.now() + waitMs);
1024
+ const resumeTimeUTC = resumeDate
1025
+ .toISOString()
1026
+ .replace('T', ' ')
1027
+ .replace(/\.\d+Z$/, ' UTC');
1028
+
1021
1029
  await log('');
1022
1030
  await log(formatAligned('⏳', 'USAGE LIMIT REACHED', ''));
1023
1031
  await log(formatAligned('', 'Reset time:', resetTime || 'Unknown', 2));
1024
1032
  await log(formatAligned('', 'Waiting:', `${waitMinutes} min (reset + ${bufferMinutes} min buffer + ${jitterSeconds}s jitter)`, 2));
1025
- await log(formatAligned('', 'Action:', 'Silently waiting then resuming — no GitHub comment posted', 2));
1033
+ await log(formatAligned('', 'Resume at:', resumeTimeUTC, 2));
1034
+ await log(formatAligned('', 'Action:', 'Posting GitHub comment and waiting for limit reset', 2));
1026
1035
  if (resumeSessionId) {
1027
1036
  await log(formatAligned('', 'Session ID:', resumeSessionId, 2));
1028
1037
  }
1029
1038
  await log('');
1030
1039
 
1031
- // Wait silently until the limit resets (no GitHub comment)
1040
+ // Issue #1570: Post a GitHub comment to notify the user about the usage limit delay.
1041
+ // This follows the same pattern as solve.watch.lib.mjs to ensure consistent user experience.
1042
+ const shouldAttachLogs = argv.attachLogs || argv['attach-logs'];
1043
+ if (prNumber && shouldAttachLogs) {
1044
+ try {
1045
+ const logFile = getLogFile();
1046
+ if (logFile) {
1047
+ await attachLogToGitHub({
1048
+ logFile,
1049
+ targetType: 'pr',
1050
+ targetNumber: prNumber,
1051
+ owner,
1052
+ repo,
1053
+ $,
1054
+ log,
1055
+ sanitizeLogContent,
1056
+ verbose: argv.verbose,
1057
+ sessionId: resumeSessionId || latestSessionId,
1058
+ tempDir,
1059
+ anthropicTotalCostUSD: toolResult.anthropicTotalCostUSD || latestAnthropicCost,
1060
+ isUsageLimit: true,
1061
+ limitResetTime: resetTime,
1062
+ toolName: `Anthropic ${(argv.tool || 'claude').charAt(0).toUpperCase() + (argv.tool || 'claude').slice(1)} Code`,
1063
+ isAutoResumeEnabled: true,
1064
+ autoResumeMode: 'restart',
1065
+ requestedModel: argv.model,
1066
+ tool: argv.tool || 'claude',
1067
+ publicPricingEstimate: toolResult.publicPricingEstimate,
1068
+ pricingInfo: toolResult.pricingInfo,
1069
+ resultModelUsage: toolResult.resultModelUsage || null,
1070
+ });
1071
+ await log(formatAligned('', '✅ Usage limit comment posted to PR', '', 2));
1072
+ }
1073
+ } catch (commentError) {
1074
+ reportError(commentError, {
1075
+ context: 'attach_usage_limit_comment_auto_restart',
1076
+ prNumber,
1077
+ owner,
1078
+ repo,
1079
+ operation: 'usage_limit_comment',
1080
+ });
1081
+ await log(formatAligned('', `⚠️ Usage limit comment upload error: ${cleanErrorMessage(commentError)}`, '', 2));
1082
+ }
1083
+ }
1084
+
1085
+ // Wait until the limit resets
1032
1086
  await new Promise(resolve => setTimeout(resolve, waitMs));
1033
1087
 
1034
1088
  await log(formatAligned('✅', 'Usage limit wait complete', 'Resuming session...'));