@link-assistant/hive-mind 1.35.12 → 1.36.0
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,18 @@
|
|
|
1
1
|
# @link-assistant/hive-mind
|
|
2
2
|
|
|
3
|
+
## 1.36.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 3adbf2b: feat: add --auto-report-issue and --disable-report-issue flags for non-interactive error reporting (Issue #1484)
|
|
8
|
+
- Add `--auto-report-issue` flag that automatically creates a GitHub issue on failure without prompting.
|
|
9
|
+
The auto-reported issue includes error details, logs, and case study analysis instructions in the body.
|
|
10
|
+
Issue is labeled as `bug`.
|
|
11
|
+
- Add `--disable-report-issue` flag that completely disables error issue creation (no prompt, no auto-creation).
|
|
12
|
+
Takes precedence over `--auto-report-issue` if both are specified.
|
|
13
|
+
- Default behavior (neither flag) preserves the existing interactive y/n prompt.
|
|
14
|
+
- Both flags are automatically available as passthrough options in hive and TELEGRAM_HIVE_OVERRIDES.
|
|
15
|
+
|
|
3
16
|
## 1.35.12
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -149,7 +149,7 @@ export const formatLogForIssue = async (logContent, logFilePath) => {
|
|
|
149
149
|
* @returns {Promise<string|null>} Issue URL or null on failure
|
|
150
150
|
*/
|
|
151
151
|
export const createIssueForError = async options => {
|
|
152
|
-
const { error, errorType, logFile, context = {} } = options;
|
|
152
|
+
const { error, errorType, logFile, context = {}, autoReport = false } = options;
|
|
153
153
|
|
|
154
154
|
try {
|
|
155
155
|
const currentUser = await getCurrentGitHubUser();
|
|
@@ -159,7 +159,20 @@ export const createIssueForError = async options => {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
const errorMessage = cleanErrorMessage(error);
|
|
162
|
-
|
|
162
|
+
|
|
163
|
+
let shouldCreateIssue;
|
|
164
|
+
if (autoReport) {
|
|
165
|
+
// Auto-report mode: skip prompt, automatically create issue
|
|
166
|
+
console.log('\n❌ An error occurred:');
|
|
167
|
+
console.log(` ${errorMessage}`);
|
|
168
|
+
if (isSentryEnabled()) {
|
|
169
|
+
console.log('\n✅ Error reported to Sentry successfully');
|
|
170
|
+
}
|
|
171
|
+
console.log('\nℹ️ --auto-report-issue enabled: automatically creating GitHub issue...');
|
|
172
|
+
shouldCreateIssue = true;
|
|
173
|
+
} else {
|
|
174
|
+
shouldCreateIssue = await promptUserForIssueCreation(errorMessage);
|
|
175
|
+
}
|
|
163
176
|
|
|
164
177
|
if (!shouldCreateIssue) {
|
|
165
178
|
await log('ℹ️ Issue creation cancelled by user');
|
|
@@ -199,6 +212,20 @@ export const createIssueForError = async options => {
|
|
|
199
212
|
}
|
|
200
213
|
}
|
|
201
214
|
|
|
215
|
+
if (autoReport) {
|
|
216
|
+
issueBody += '### Instructions\n\n';
|
|
217
|
+
issueBody += 'We need to download all logs and data related about the issue to this repository, ';
|
|
218
|
+
issueBody += 'make sure we compile that data to `./docs/case-studies/issue-{id}` folder, ';
|
|
219
|
+
issueBody += 'and use it to do deep case study analysis (also make sure to search online for additional facts and data), ';
|
|
220
|
+
issueBody += 'in which we will reconstruct timeline/sequence of events, find root causes of the problem, ';
|
|
221
|
+
issueBody += 'and propose possible solutions (including known existing components/libraries, ';
|
|
222
|
+
issueBody += 'that solve similar problem or can help in solutions).\n\n';
|
|
223
|
+
issueBody += 'If there is not enough data to find actual root cause, add debug output and verbose mode if not present, ';
|
|
224
|
+
issueBody += 'that will allow us to find root cause on next iteration.\n\n';
|
|
225
|
+
issueBody += 'If issue related to any other repository/project, where we can report issues on GitHub, please do so. ';
|
|
226
|
+
issueBody += 'Each issue must contain reproducible examples, workarounds and suggestions for fix the issue in code.\n\n';
|
|
227
|
+
}
|
|
228
|
+
|
|
202
229
|
issueBody += '---\n';
|
|
203
230
|
issueBody += `*This issue was automatically created by @${currentUser} using hive-mind error reporting*\n`;
|
|
204
231
|
|
|
@@ -239,7 +266,24 @@ export const createIssueForError = async options => {
|
|
|
239
266
|
* @returns {Promise<string|null>} Issue URL if created, null otherwise
|
|
240
267
|
*/
|
|
241
268
|
export const handleErrorWithIssueCreation = async options => {
|
|
242
|
-
const { error, errorType, logFile, context = {}, skipPrompt = false } = options;
|
|
269
|
+
const { error, errorType, logFile, context = {}, skipPrompt = false, autoReport = false, disableReport = false } = options;
|
|
270
|
+
|
|
271
|
+
// --disable-report-issue takes highest precedence
|
|
272
|
+
if (disableReport) {
|
|
273
|
+
await log('ℹ️ Issue reporting disabled via --disable-report-issue.');
|
|
274
|
+
return null;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// --auto-report-issue: create issue automatically without prompting
|
|
278
|
+
if (autoReport) {
|
|
279
|
+
return await createIssueForError({
|
|
280
|
+
error,
|
|
281
|
+
errorType,
|
|
282
|
+
logFile: logFile || (await getAbsoluteLogPath()),
|
|
283
|
+
context,
|
|
284
|
+
autoReport: true,
|
|
285
|
+
});
|
|
286
|
+
}
|
|
243
287
|
|
|
244
288
|
if (skipPrompt) {
|
|
245
289
|
return null;
|
package/src/solve.config.lib.mjs
CHANGED
|
@@ -369,6 +369,16 @@ export const SOLVE_OPTION_DEFINITIONS = {
|
|
|
369
369
|
description: 'Automatically initialize empty repositories by creating a simple README.md file. Only works when you have write access to the repository. This allows branch creation and pull request workflows to proceed on repositories that have no commits.',
|
|
370
370
|
default: false,
|
|
371
371
|
},
|
|
372
|
+
'auto-report-issue': {
|
|
373
|
+
type: 'boolean',
|
|
374
|
+
description: 'Automatically create a GitHub issue on failure without prompting (non-interactive mode). The issue includes error details, logs, and case study analysis instructions. Sets issue type and label to bug.',
|
|
375
|
+
default: false,
|
|
376
|
+
},
|
|
377
|
+
'disable-report-issue': {
|
|
378
|
+
type: 'boolean',
|
|
379
|
+
description: 'Disable error issue creation entirely (no prompt, no automatic creation). Overrides --auto-report-issue if both are specified.',
|
|
380
|
+
default: false,
|
|
381
|
+
},
|
|
372
382
|
'attach-solution-summary': {
|
|
373
383
|
type: 'boolean',
|
|
374
384
|
description: 'Attach the AI solution summary (from the result field) as a comment to the PR/issue after completion. The summary is extracted from the AI tool JSON output and posted under a "Solution summary" header.',
|
|
@@ -30,6 +30,8 @@ export const handleFailure = async options => {
|
|
|
30
30
|
errorType,
|
|
31
31
|
},
|
|
32
32
|
skipPrompt: !process.stdin.isTTY || argv.noIssueCreation,
|
|
33
|
+
autoReport: argv.autoReportIssue,
|
|
34
|
+
disableReport: argv.disableReportIssue,
|
|
33
35
|
});
|
|
34
36
|
} catch (issueError) {
|
|
35
37
|
reportError(issueError, {
|