@link-assistant/hive-mind 0.51.13 → 0.51.15

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,30 @@
1
1
  # @link-assistant/hive-mind
2
2
 
3
+ ## 0.51.15
4
+
5
+ ### Patch Changes
6
+
7
+ - 93a0af9: Add case study for issue #964: Discussion comments not loaded to AI context
8
+
9
+ This case study documents the root cause analysis of why the AI solver failed to see and respond to repository owner feedback on PR #13 in the eg0rmaffin/vapor-rice-i3 repository. The investigation revealed two independent root causes:
10
+ 1. The feedback system tells the AI the count of new comments but not their content
11
+ 2. The AI used an incomplete API command that only fetches conversation comments, missing review comments
12
+
13
+ The case study includes proposed solutions to fix this issue.
14
+
15
+ ## 0.51.14
16
+
17
+ ### Patch Changes
18
+
19
+ - 4e4fe08: Improve fork divergence error message clarity
20
+ - Remove misleading "Option 3: Work without syncing fork (NOT RECOMMENDED)"
21
+ - Add new Option 1 for deleting and recreating fork (marked as SIMPLEST)
22
+ - Reorder options by simplicity: deletion → auto-resolution → manual resolution
23
+ - Move risk warnings inline with relevant options for better context
24
+ - Add comprehensive case study documentation in docs/case-studies/issue-972/
25
+
26
+ This change makes the error message more useful by removing options that were never actually viable and adding the fork deletion option as the cleanest solution for most fork divergence scenarios.
27
+
3
28
  ## 0.51.13
4
29
 
5
30
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@link-assistant/hive-mind",
3
- "version": "0.51.13",
3
+ "version": "0.51.15",
4
4
  "description": "AI-powered issue solver and hive mind for collaborative problem solving",
5
5
  "main": "src/hive.mjs",
6
6
  "type": "module",
@@ -114,7 +114,11 @@ Initial research.
114
114
  - When accessing GitHub Gists, use gh gist view command instead of direct URL fetching.
115
115
  - When you are fixing a bug, please make sure you first find the actual root cause, do as many experiments as needed.
116
116
  - When you are fixing a bug and code does not have enough tracing/logs, add them and make sure they stay in the code, but are switched off by default.
117
- - When you need latest comments on pull request, use gh api repos/${owner}/${repo}/pulls/${prNumber}/comments --paginate.
117
+ - When you need comments on a pull request, note that GitHub has THREE different comment types with different API endpoints:
118
+ 1. PR review comments (inline code comments): gh api repos/${owner}/${repo}/pulls/${prNumber}/comments --paginate
119
+ 2. PR conversation comments (general discussion): gh api repos/${owner}/${repo}/issues/${prNumber}/comments --paginate
120
+ 3. PR reviews (approve/request changes): gh api repos/${owner}/${repo}/pulls/${prNumber}/reviews --paginate
121
+ IMPORTANT: The command "gh pr view --json comments" ONLY returns conversation comments and misses review comments!
118
122
  - When you need latest comments on issue, use gh api repos/${owner}/${repo}/issues/${issueNumber}/comments --paginate.
119
123
 
120
124
  Solution development and testing.
@@ -168,7 +172,9 @@ Self review.
168
172
 
169
173
  GitHub CLI command patterns.
170
174
  - IMPORTANT: Always use --paginate flag when fetching lists from GitHub API to ensure all results are returned (GitHub returns max 30 per page by default).
171
- - When listing PR comments, use gh api repos/OWNER/REPO/pulls/NUMBER/comments --paginate.
175
+ - When listing PR review comments (inline code comments), use gh api repos/OWNER/REPO/pulls/NUMBER/comments --paginate.
176
+ - When listing PR conversation comments, use gh api repos/OWNER/REPO/issues/NUMBER/comments --paginate.
177
+ - When listing PR reviews, use gh api repos/OWNER/REPO/pulls/NUMBER/reviews --paginate.
172
178
  - When listing issue comments, use gh api repos/OWNER/REPO/issues/NUMBER/comments --paginate.
173
179
  - When adding PR comment, use gh pr comment NUMBER --body "text" --repo OWNER/REPO.
174
180
  - When adding issue comment, use gh issue comment NUMBER --body "text" --repo OWNER/REPO.
@@ -130,7 +130,11 @@ Initial research.
130
130
  - When accessing GitHub Gists (especially private ones), use gh gist view command instead of direct URL fetching to ensure proper authentication.
131
131
  - When you are fixing a bug, please make sure you first find the actual root cause, do as many experiments as needed.
132
132
  - When you are fixing a bug and code does not have enough tracing/logs, add them and make sure they stay in the code, but are switched off by default.
133
- - When you need latest comments on pull request, use gh api repos/${owner}/${repo}/pulls/${prNumber}/comments --paginate.
133
+ - When you need comments on a pull request, note that GitHub has THREE different comment types with different API endpoints:
134
+ 1. PR review comments (inline code comments): gh api repos/${owner}/${repo}/pulls/${prNumber}/comments --paginate
135
+ 2. PR conversation comments (general discussion): gh api repos/${owner}/${repo}/issues/${prNumber}/comments --paginate
136
+ 3. PR reviews (approve/request changes): gh api repos/${owner}/${repo}/pulls/${prNumber}/reviews --paginate
137
+ IMPORTANT: The command "gh pr view --json comments" ONLY returns conversation comments and misses review comments!
134
138
  - When you need latest comments on issue, use gh api repos/${owner}/${repo}/issues/${issueNumber}/comments --paginate.${argv && argv.promptGeneralPurposeSubAgent ? '\n - When the task is big and requires processing of lots of files or folders, you should use the `general-purpose` sub agents to delegate work. Each separate file or folder can be delegated to a sub agent for more efficient processing.' : ''}${argv && argv.promptCaseStudies ? `\n - When working on this issue, create a comprehensive case study in the ./docs/case-studies/issue-${issueNumber}/ directory. Download all logs and data related to the issue to the repository. Perform deep case study analysis by searching online for additional facts and data, reconstructing the timeline/sequence of events, identifying root causes of the problem, and proposing possible solutions. Include files like README.md (executive summary, problem statement, timeline, root cause), TECHNICAL_SUMMARY.md (deep technical analysis), ANALYSIS.md (detailed investigation findings), improvements.md (proposed solutions), and supporting logs/data files.` : ''}
135
139
 
136
140
  Solution development and testing.
@@ -185,7 +189,9 @@ Self review.
185
189
 
186
190
  GitHub CLI command patterns.
187
191
  - IMPORTANT: Always use --paginate flag when fetching lists from GitHub API to ensure all results are returned (GitHub returns max 30 per page by default).
188
- - When listing PR comments, use gh api repos/OWNER/REPO/pulls/NUMBER/comments --paginate.
192
+ - When listing PR review comments (inline code comments), use gh api repos/OWNER/REPO/pulls/NUMBER/comments --paginate.
193
+ - When listing PR conversation comments, use gh api repos/OWNER/REPO/issues/NUMBER/comments --paginate.
194
+ - When listing PR reviews, use gh api repos/OWNER/REPO/pulls/NUMBER/reviews --paginate.
189
195
  - When listing issue comments, use gh api repos/OWNER/REPO/issues/NUMBER/comments --paginate.
190
196
  - When adding PR comment, use gh pr comment NUMBER --body "text" --repo OWNER/REPO.
191
197
  - When adding issue comment, use gh issue comment NUMBER --body "text" --repo OWNER/REPO.
@@ -122,7 +122,11 @@ Initial research.
122
122
  - When accessing GitHub Gists (especially private ones), use gh gist view command instead of direct URL fetching to ensure proper authentication.
123
123
  - When you are fixing a bug, please make sure you first find the actual root cause, do as many experiments as needed.
124
124
  - When you are fixing a bug and code does not have enough tracing/logs, add them and make sure they stay in the code, but are switched off by default.
125
- - When you need latest comments on pull request, use gh api repos/${owner}/${repo}/pulls/${prNumber}/comments --paginate.
125
+ - When you need comments on a pull request, note that GitHub has THREE different comment types with different API endpoints:
126
+ 1. PR review comments (inline code comments): gh api repos/${owner}/${repo}/pulls/${prNumber}/comments --paginate
127
+ 2. PR conversation comments (general discussion): gh api repos/${owner}/${repo}/issues/${prNumber}/comments --paginate
128
+ 3. PR reviews (approve/request changes): gh api repos/${owner}/${repo}/pulls/${prNumber}/reviews --paginate
129
+ IMPORTANT: The command "gh pr view --json comments" ONLY returns conversation comments and misses review comments!
126
130
  - When you need latest comments on issue, use gh api repos/${owner}/${repo}/issues/${issueNumber}/comments --paginate.
127
131
 
128
132
  Solution development and testing.
@@ -176,7 +180,9 @@ Self review.
176
180
 
177
181
  GitHub CLI command patterns.
178
182
  - IMPORTANT: Always use --paginate flag when fetching lists from GitHub API to ensure all results are returned (GitHub returns max 30 per page by default).
179
- - When listing PR comments, use gh api repos/OWNER/REPO/pulls/NUMBER/comments --paginate.
183
+ - When listing PR review comments (inline code comments), use gh api repos/OWNER/REPO/pulls/NUMBER/comments --paginate.
184
+ - When listing PR conversation comments, use gh api repos/OWNER/REPO/issues/NUMBER/comments --paginate.
185
+ - When listing PR reviews, use gh api repos/OWNER/REPO/pulls/NUMBER/reviews --paginate.
180
186
  - When listing issue comments, use gh api repos/OWNER/REPO/issues/NUMBER/comments --paginate.
181
187
  - When adding PR comment, use gh pr comment NUMBER --body "text" --repo OWNER/REPO.
182
188
  - When adding issue comment, use gh issue comment NUMBER --body "text" --repo OWNER/REPO.
@@ -114,7 +114,11 @@ Initial research.
114
114
  - When accessing GitHub Gists, use gh gist view command instead of direct URL fetching.
115
115
  - When you are fixing a bug, please make sure you first find the actual root cause, do as many experiments as needed.
116
116
  - When you are fixing a bug and code does not have enough tracing/logs, add them and make sure they stay in the code, but are switched off by default.
117
- - When you need latest comments on pull request, use gh api repos/${owner}/${repo}/pulls/${prNumber}/comments --paginate.
117
+ - When you need comments on a pull request, note that GitHub has THREE different comment types with different API endpoints:
118
+ 1. PR review comments (inline code comments): gh api repos/${owner}/${repo}/pulls/${prNumber}/comments --paginate
119
+ 2. PR conversation comments (general discussion): gh api repos/${owner}/${repo}/issues/${prNumber}/comments --paginate
120
+ 3. PR reviews (approve/request changes): gh api repos/${owner}/${repo}/pulls/${prNumber}/reviews --paginate
121
+ IMPORTANT: The command "gh pr view --json comments" ONLY returns conversation comments and misses review comments!
118
122
  - When you need latest comments on issue, use gh api repos/${owner}/${repo}/issues/${issueNumber}/comments --paginate.
119
123
 
120
124
  Solution development and testing.
@@ -167,7 +171,9 @@ Self review.
167
171
 
168
172
  GitHub CLI command patterns.
169
173
  - IMPORTANT: Always use --paginate flag when fetching lists from GitHub API to ensure all results are returned (GitHub returns max 30 per page by default).
170
- - When listing PR comments, use gh api repos/OWNER/REPO/pulls/NUMBER/comments --paginate.
174
+ - When listing PR review comments (inline code comments), use gh api repos/OWNER/REPO/pulls/NUMBER/comments --paginate.
175
+ - When listing PR conversation comments, use gh api repos/OWNER/REPO/issues/NUMBER/comments --paginate.
176
+ - When listing PR reviews, use gh api repos/OWNER/REPO/pulls/NUMBER/reviews --paginate.
171
177
  - When listing issue comments, use gh api repos/OWNER/REPO/issues/NUMBER/comments --paginate.
172
178
  - When adding PR comment, use gh pr comment NUMBER --body "text" --repo OWNER/REPO.
173
179
  - When adding issue comment, use gh issue comment NUMBER --body "text" --repo OWNER/REPO.
@@ -10,6 +10,7 @@ export const detectAndCountFeedback = async params => {
10
10
  const { prNumber, branchName, owner, repo, issueNumber, isContinueMode, argv, mergeStateStatus, prState, workStartTime, log, formatAligned, cleanErrorMessage, $ } = params;
11
11
 
12
12
  let newPrComments = 0;
13
+ let newPrReviewComments = 0;
13
14
  let newIssueComments = 0;
14
15
  let commentInfo = '';
15
16
  let feedbackLines = [];
@@ -104,10 +105,8 @@ export const detectAndCountFeedback = async params => {
104
105
  prConversationComments = JSON.parse(prConversationCommentsResult.stdout.toString());
105
106
  }
106
107
 
107
- // Combine and count all PR comments after last commit
108
- // Filter out comments from current user if made after work started AND filter out log comments
109
- const allPrComments = [...prReviewComments, ...prConversationComments];
110
- const filteredPrComments = allPrComments.filter(comment => {
108
+ // Helper function to filter comments based on time and log patterns
109
+ const filterComment = comment => {
111
110
  const commentTime = new Date(comment.created_at);
112
111
  const isAfterCommit = commentTime > lastCommitTime;
113
112
  const isNotLogPattern = !logPatterns.some(pattern => pattern.test(comment.body || ''));
@@ -122,8 +121,18 @@ export const detectAndCountFeedback = async params => {
122
121
  }
123
122
 
124
123
  return isAfterCommit && isNotLogPattern;
125
- });
126
- newPrComments = filteredPrComments.length;
124
+ };
125
+
126
+ // Filter and count PR review comments (inline code comments) separately
127
+ const filteredPrReviewComments = prReviewComments.filter(filterComment);
128
+ newPrReviewComments = filteredPrReviewComments.length;
129
+
130
+ // Filter and count PR conversation comments separately
131
+ const filteredPrConversationComments = prConversationComments.filter(filterComment);
132
+ newPrComments = filteredPrConversationComments.length;
133
+
134
+ // Combined count for logging purposes
135
+ const allPrComments = [...prReviewComments, ...prConversationComments];
127
136
 
128
137
  // Count new issue comments after last commit
129
138
  // Use --paginate to get all comments - GitHub API returns max 30 per page by default
@@ -150,11 +159,12 @@ export const detectAndCountFeedback = async params => {
150
159
  }
151
160
 
152
161
  await log(formatAligned('💬', 'New PR comments:', newPrComments.toString(), 2));
162
+ await log(formatAligned('💬', 'New PR review comments:', newPrReviewComments.toString(), 2));
153
163
  await log(formatAligned('💬', 'New issue comments:', newIssueComments.toString(), 2));
154
164
 
155
165
  if (argv.verbose) {
156
- await log(` Total new comments: ${newPrComments + newIssueComments}`, { verbose: true });
157
- await log(` Comment lines to add: ${newPrComments > 0 || newIssueComments > 0 ? 'Yes' : 'No (saving tokens)'}`, { verbose: true });
166
+ await log(` Total new comments: ${newPrComments + newPrReviewComments + newIssueComments}`, { verbose: true });
167
+ await log(` Comment lines to add: ${newPrComments > 0 || newPrReviewComments > 0 || newIssueComments > 0 ? 'Yes' : 'No (saving tokens)'}`, { verbose: true });
158
168
  await log(` PR review comments fetched: ${prReviewComments.length}`, { verbose: true });
159
169
  await log(` PR conversation comments fetched: ${prConversationComments.length}`, { verbose: true });
160
170
  await log(` Total PR comments checked: ${allPrComments.length}`, { verbose: true });
@@ -162,7 +172,7 @@ export const detectAndCountFeedback = async params => {
162
172
 
163
173
  // Check if --auto-continue-only-on-new-comments is enabled and fail if no new comments
164
174
  if (argv.autoContinueOnlyOnNewComments && (isContinueMode || argv.autoContinue)) {
165
- const totalNewComments = newPrComments + newIssueComments;
175
+ const totalNewComments = newPrComments + newPrReviewComments + newIssueComments;
166
176
  if (totalNewComments === 0) {
167
177
  await log('❌ auto-continue-only-on-new-comments: No new comments found since last commit');
168
178
  await log(' This option requires new comments to proceed with auto-continue or continue mode.');
@@ -181,6 +191,9 @@ export const detectAndCountFeedback = async params => {
181
191
  if (newPrComments > 0) {
182
192
  feedbackLines.push(`New comments on the pull request: ${newPrComments}`);
183
193
  }
194
+ if (newPrReviewComments > 0) {
195
+ feedbackLines.push(`New review comments on the pull request: ${newPrReviewComments}`);
196
+ }
184
197
  if (newIssueComments > 0) {
185
198
  feedbackLines.push(`New comments on the issue: ${newIssueComments}`);
186
199
  }
@@ -192,7 +205,7 @@ export const detectAndCountFeedback = async params => {
192
205
  }
193
206
 
194
207
  // 1. Check for new comments (already filtered above)
195
- const totalNewComments = newPrComments + newIssueComments;
208
+ const totalNewComments = newPrComments + newPrReviewComments + newIssueComments;
196
209
  if (totalNewComments > 0) {
197
210
  feedbackDetected = true;
198
211
  feedbackSources.push(`New comments (${totalNewComments})`);
@@ -413,5 +426,5 @@ export const detectAndCountFeedback = async params => {
413
426
  }
414
427
  }
415
428
 
416
- return { newPrComments, newIssueComments, commentInfo, feedbackLines };
429
+ return { newPrComments, newPrReviewComments, newIssueComments, commentInfo, feedbackLines };
417
430
  };
@@ -946,18 +946,19 @@ export const setupUpstreamAndSync = async (tempDir, forkedRepo, upstreamRemote,
946
946
  }
947
947
  } else {
948
948
  // Flag is not enabled - provide guidance
949
- await log(' ⚠️ RISKS of force-pushing:');
950
- await log(' • Overwrites fork history - any unique commits in your fork will be LOST');
951
- await log(' • Other collaborators working on your fork may face conflicts');
952
- await log(' • Cannot be undone - use with extreme caution');
953
- await log('');
954
949
  await log(' 💡 Your options:');
955
950
  await log('');
956
- await log(' Option 1: Enable automatic force-push (DANGEROUS)');
951
+ await log(' Option 1: Delete your fork and recreate it (SIMPLEST)');
952
+ await log(` gh repo delete ${forkedRepo}`);
953
+ await log(' Then run the solve command again - the fork will be recreated automatically');
954
+ await log(' ⚠️ Only use this if your fork has no unique commits you need to preserve');
955
+ await log('');
956
+ await log(' Option 2: Enable automatic force-push (DANGEROUS)');
957
957
  await log(' Add --allow-fork-divergence-resolution-using-force-push-with-lease flag to your command');
958
958
  await log(' This will automatically sync your fork with upstream using force-with-lease');
959
+ await log(' ⚠️ Overwrites fork history - any unique commits will be LOST');
959
960
  await log('');
960
- await log(' Option 2: Manually resolve the divergence');
961
+ await log(' Option 3: Manually resolve the divergence');
961
962
  await log(' 1. Decide if you need any commits unique to your fork');
962
963
  await log(' 2. If yes, cherry-pick them after syncing');
963
964
  await log(' 3. If no, manually force-push:');
@@ -965,10 +966,6 @@ export const setupUpstreamAndSync = async (tempDir, forkedRepo, upstreamRemote,
965
966
  await log(` git reset --hard upstream/${upstreamDefaultBranch}`);
966
967
  await log(` git push --force origin ${upstreamDefaultBranch}`);
967
968
  await log('');
968
- await log(' Option 3: Work without syncing fork (NOT RECOMMENDED)');
969
- await log(' Your fork will remain out-of-sync with upstream');
970
- await log(' May cause merge conflicts in pull requests');
971
- await log('');
972
969
  await log(' 🔧 To proceed with auto-resolution, restart with:');
973
970
  await log(` solve ${argv.url || argv['issue-url'] || argv._[0] || '<issue-url>'} --allow-fork-divergence-resolution-using-force-push-with-lease`);
974
971
  await log('');