@link-assistant/hive-mind 1.10.0 → 1.10.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,28 @@
1
1
  # @link-assistant/hive-mind
2
2
 
3
+ ## 1.10.2
4
+
5
+ ### Patch Changes
6
+
7
+ - e1ed8fc: fix: enable large log file uploads using gh-upload-log (issue #1173)
8
+ - Remove premature 25MB size check that incorrectly rejected large log files
9
+ - Files larger than 25MB now use gh-upload-log which can handle any size
10
+ - Default to private visibility when repository visibility cannot be determined (safer for private repos)
11
+ - Add case study documentation for issue #1173
12
+
13
+ ## 1.10.1
14
+
15
+ ### Patch Changes
16
+
17
+ - 24e70f8: Fix agent --verbose output by properly handling stderr stream
18
+ - Agent CLI sends ALL output (including verbose logs and structured events) to stderr, not stdout
19
+ - Previous code only processed stdout with JSON parsing, treating stderr as plain error text
20
+ - Now stderr is processed the same way as stdout: NDJSON line-by-line parsing with JSON formatting
21
+ - Session IDs are now correctly extracted from stderr messages
22
+ - stderr output is now collected for error detection
23
+
24
+ Fixes #1151
25
+
3
26
  ## 1.10.0
4
27
 
5
28
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@link-assistant/hive-mind",
3
- "version": "1.10.0",
3
+ "version": "1.10.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",
package/src/agent.lib.mjs CHANGED
@@ -440,7 +440,27 @@ export const executeAgentCommand = async params => {
440
440
  if (chunk.type === 'stderr') {
441
441
  const errorOutput = chunk.data.toString();
442
442
  if (errorOutput) {
443
- await log(errorOutput, { stream: 'stderr' });
443
+ // Agent sends all output (including verbose logs and structured events) to stderr
444
+ // Process each line as NDJSON, same as stdout handling
445
+ const stderrLines = errorOutput.split('\n');
446
+ for (const stderrLine of stderrLines) {
447
+ if (!stderrLine.trim()) continue;
448
+ try {
449
+ const stderrData = JSON.parse(stderrLine);
450
+ // Output formatted JSON (same formatting as stdout)
451
+ await log(JSON.stringify(stderrData, null, 2));
452
+ // Capture session ID from stderr too (agent sends it via stderr)
453
+ if (!sessionId && stderrData.sessionID) {
454
+ sessionId = stderrData.sessionID;
455
+ await log(`📌 Session ID: ${sessionId}`);
456
+ }
457
+ } catch {
458
+ // Not JSON - log as plain text
459
+ await log(stderrLine);
460
+ }
461
+ }
462
+ // Also collect stderr for error detection
463
+ fullOutput += errorOutput;
444
464
  }
445
465
  } else if (chunk.type === 'exit') {
446
466
  exitCode = chunk.code;
@@ -391,9 +391,13 @@ export async function attachLogToGitHub(options) {
391
391
  if (logStats.size === 0) {
392
392
  await log(' ⚠️ Log file is empty, skipping upload');
393
393
  return false;
394
- } else if (logStats.size > githubLimits.fileMaxSize) {
395
- await log(` ⚠️ Log file too large (${Math.round(logStats.size / 1024 / 1024)}MB), GitHub limit is ${Math.round(githubLimits.fileMaxSize / 1024 / 1024)}MB`);
396
- return false;
394
+ }
395
+ // Issue #1173: Remove premature size check that blocked large files.
396
+ // gh-upload-log can handle files of any size by using repositories for large files.
397
+ // For files larger than fileMaxSize, we'll skip inline comment attempt and go directly to gh-upload-log.
398
+ const useLargeFileMode = logStats.size > githubLimits.fileMaxSize;
399
+ if (useLargeFileMode && verbose) {
400
+ await log(` 📁 Large log file (${Math.round(logStats.size / 1024 / 1024)}MB), will use gh-upload-log`, { verbose: true });
397
401
  }
398
402
  // Calculate token usage if sessionId and tempDir are provided
399
403
  // For agent tool, publicPricingEstimate is already provided, so we skip Claude-specific calculation
@@ -539,13 +543,19 @@ ${logContent}
539
543
  ---
540
544
  *Now working session is ended, feel free to review and add any feedback on the solution draft.*`;
541
545
  }
542
- // Check GitHub comment size limit
546
+ // Check GitHub comment size limit or large file mode
547
+ // Issue #1173: Also use gh-upload-log for large files, not just long comments
543
548
  let commentResult;
544
- if (logComment.length > githubLimits.commentMaxSize) {
545
- await log(` ⚠️ Log comment too long (${logComment.length} chars), GitHub limit is ${githubLimits.commentMaxSize} chars`);
549
+ if (useLargeFileMode || logComment.length > githubLimits.commentMaxSize) {
550
+ if (useLargeFileMode) {
551
+ await log(` 📁 Log file too large for inline comment (${Math.round(logStats.size / 1024 / 1024)}MB), using gh-upload-log`);
552
+ } else {
553
+ await log(` ⚠️ Log comment too long (${logComment.length} chars), GitHub limit is ${githubLimits.commentMaxSize} chars`);
554
+ }
546
555
  await log(' 📎 Uploading log using gh-upload-log...');
547
556
  try {
548
557
  // Check if repository is public or private
558
+ // Issue #1173: Use public upload for public repos, private for private repos
549
559
  let isPublicRepo = true;
550
560
  try {
551
561
  const repoVisibilityResult = await $`gh api repos/${owner}/${repo} --jq .visibility`;
@@ -553,7 +563,7 @@ ${logContent}
553
563
  const visibility = repoVisibilityResult.stdout.toString().trim();
554
564
  isPublicRepo = visibility === 'public';
555
565
  if (verbose) {
556
- await log(` 🔍 Repository visibility: ${visibility}`, { verbose: true });
566
+ await log(` 🔍 Repository visibility: ${visibility}, log upload will be ${isPublicRepo ? 'public' : 'private'}`, { verbose: true });
557
567
  }
558
568
  }
559
569
  } catch (visibilityError) {
@@ -563,8 +573,9 @@ ${logContent}
563
573
  owner,
564
574
  repo,
565
575
  });
566
- // Default to public if we can't determine visibility
567
- await log(' ⚠️ Could not determine repository visibility, defaulting to public', { verbose: true });
576
+ // Default to private if we can't determine visibility (safer for private repos)
577
+ isPublicRepo = false;
578
+ await log(' ⚠️ Could not determine repository visibility, defaulting to private for safety');
568
579
  }
569
580
  // Create temp log file with sanitized content (no compression, just gh-upload-log)
570
581
  const tempLogFile = `/tmp/solution-draft-log-${targetType}-${Date.now()}.txt`;