@link-assistant/hive-mind 1.56.13 → 1.56.14
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 +6 -0
- package/package.json +2 -2
- package/src/github.lib.mjs +33 -5
- package/src/solve.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @link-assistant/hive-mind
|
|
2
2
|
|
|
3
|
+
## 1.56.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 77d6be2: Prevent failure-log uploads from posting broken `null` links and replace green-check failure-log terminal status with neutral attachment wording.
|
|
8
|
+
|
|
3
9
|
## 1.56.13
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@link-assistant/hive-mind",
|
|
3
|
-
"version": "1.56.
|
|
3
|
+
"version": "1.56.14",
|
|
4
4
|
"description": "AI-powered issue solver and hive mind for collaborative problem solving",
|
|
5
5
|
"main": "src/hive.mjs",
|
|
6
6
|
"type": "module",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"hive-telegram-bot": "./src/telegram-bot.mjs"
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
|
-
"test": "node tests/solve-queue.test.mjs && node tests/limits-display.test.mjs && node tests/test-usage-limit.mjs && node tests/test-codex-support.mjs && node tests/test-build-cost-info-string.mjs && node tests/test-claude-code-install-method.mjs && node tests/test-claude-quiet-config.mjs && node tests/test-configure-claude-bin.mjs && node tests/test-docker-release-order.mjs && node tests/test-docker-box-migration.mjs && node tests/test-hive-screens.mjs && node tests/test-issue-1616-pr-issue-link-preservation.mjs && node tests/test-pre-pr-failure-notifier-1640.mjs && node tests/test-ready-to-merge-pagination-1645.mjs && node tests/test-require-gh-paginate-rule.mjs && node tests/test-auto-restart-limits-1664.mjs && node tests/test-log-upload-output-1678.mjs && node tests/test-telegram-message-filters.mjs && node tests/test-telegram-bot-command-aliases.mjs && node tests/test-telegram-options-before-url.mjs && node tests/test-telegram-bot-configuration-isolation-links-notation.mjs && node tests/test-extract-isolation-from-args.mjs && node tests/test-solve-queue-command.mjs && node tests/test-queue-display-1267.mjs && node tests/test-issue-1670-screen-status-monitoring.mjs && node tests/test-issue-1680-session-monitoring.mjs && node tests/test-telegram-bot-launcher.mjs",
|
|
18
|
+
"test": "node tests/solve-queue.test.mjs && node tests/limits-display.test.mjs && node tests/test-usage-limit.mjs && node tests/test-codex-support.mjs && node tests/test-build-cost-info-string.mjs && node tests/test-claude-code-install-method.mjs && node tests/test-claude-quiet-config.mjs && node tests/test-configure-claude-bin.mjs && node tests/test-docker-release-order.mjs && node tests/test-docker-box-migration.mjs && node tests/test-hive-screens.mjs && node tests/test-issue-1616-pr-issue-link-preservation.mjs && node tests/test-pre-pr-failure-notifier-1640.mjs && node tests/test-ready-to-merge-pagination-1645.mjs && node tests/test-require-gh-paginate-rule.mjs && node tests/test-auto-restart-limits-1664.mjs && node tests/test-log-upload-output-1678.mjs && node tests/test-log-upload-output-1682.mjs && node tests/test-telegram-message-filters.mjs && node tests/test-telegram-bot-command-aliases.mjs && node tests/test-telegram-options-before-url.mjs && node tests/test-telegram-bot-configuration-isolation-links-notation.mjs && node tests/test-extract-isolation-from-args.mjs && node tests/test-solve-queue-command.mjs && node tests/test-queue-display-1267.mjs && node tests/test-issue-1670-screen-status-monitoring.mjs && node tests/test-issue-1680-session-monitoring.mjs && node tests/test-telegram-bot-launcher.mjs",
|
|
19
19
|
"test:queue": "node tests/solve-queue.test.mjs",
|
|
20
20
|
"test:limits-display": "node tests/limits-display.test.mjs",
|
|
21
21
|
"test:usage-limit": "node tests/test-usage-limit.mjs",
|
package/src/github.lib.mjs
CHANGED
|
@@ -299,6 +299,26 @@ Thank you! 🙏`;
|
|
|
299
299
|
return false;
|
|
300
300
|
}
|
|
301
301
|
};
|
|
302
|
+
export const selectLogUploadUrl = ({ uploadResult, isPublicRepo }) => {
|
|
303
|
+
if (!uploadResult?.success) return null;
|
|
304
|
+
|
|
305
|
+
const chunks = Number.isFinite(uploadResult.chunks) ? uploadResult.chunks : 1;
|
|
306
|
+
const rawUrl = uploadResult.rawUrl || null;
|
|
307
|
+
const pageUrl = uploadResult.url || null;
|
|
308
|
+
const canUseRawUrl = chunks === 1 && rawUrl && (isPublicRepo || uploadResult.type !== 'repository');
|
|
309
|
+
|
|
310
|
+
return canUseRawUrl ? rawUrl : pageUrl;
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
const isUsableLogUrl = value => typeof value === 'string' && /^https:\/\/[^\s)]+$/u.test(value);
|
|
314
|
+
|
|
315
|
+
const getLogUploadTerminalStatus = ({ errorMessage, errorDuringExecution, isUsageLimit }) => {
|
|
316
|
+
if (errorMessage) return { emoji: '📎', label: 'Failure log' };
|
|
317
|
+
if (errorDuringExecution) return { emoji: '📎', label: 'Finished-with-errors log' };
|
|
318
|
+
if (isUsageLimit) return { emoji: '📎', label: 'Usage-limit execution log' };
|
|
319
|
+
return { emoji: '✅', label: 'Solution draft log' };
|
|
320
|
+
};
|
|
321
|
+
|
|
302
322
|
/** Attaches a log file to a GitHub PR or issue as a comment. Returns true if upload succeeded. */
|
|
303
323
|
export async function attachLogToGitHub(options) {
|
|
304
324
|
const fs = (await use('fs')).promises;
|
|
@@ -616,8 +636,14 @@ ${logContent}
|
|
|
616
636
|
// Requirements: 1 chunk = direct raw link, >1 chunks = repo link
|
|
617
637
|
// Private repository raw URLs can contain short-lived tokens, so keep
|
|
618
638
|
// private uploads on the stable repository/tree page URL.
|
|
619
|
-
const
|
|
620
|
-
|
|
639
|
+
const logUrl = selectLogUploadUrl({ uploadResult, isPublicRepo });
|
|
640
|
+
if (!isUsableLogUrl(logUrl)) {
|
|
641
|
+
await log(' ❌ gh-upload-log completed but no usable log URL was resolved');
|
|
642
|
+
await log(' ⚠️ Full log upload failed; not posting a broken log link');
|
|
643
|
+
await log(` 📁 Full log remains available locally at: ${logFile}`);
|
|
644
|
+
return false;
|
|
645
|
+
}
|
|
646
|
+
|
|
621
647
|
const uploadTypeLabel = uploadResult.type === 'gist' ? 'Gist' : 'Repository';
|
|
622
648
|
const chunkInfo = uploadResult.chunks > 1 ? ` (${uploadResult.chunks} chunks)` : '';
|
|
623
649
|
|
|
@@ -745,7 +771,8 @@ ${sessionNote}
|
|
|
745
771
|
const posted = await postTrackedCommentFromFile({ $, owner, repo, targetNumber, bodyFile: tempCommentFile });
|
|
746
772
|
await fs.unlink(tempCommentFile).catch(() => {});
|
|
747
773
|
if (posted.ok) {
|
|
748
|
-
|
|
774
|
+
const status = getLogUploadTerminalStatus({ errorMessage, errorDuringExecution, isUsageLimit });
|
|
775
|
+
await log(` ${status.emoji} ${status.label} uploaded to ${targetName} as ${isPublicRepo ? 'public' : 'private'} ${uploadTypeLabel}${chunkInfo}${posted.commentId ? ` (comment id=${posted.commentId})` : ''}`);
|
|
749
776
|
await log(` 🔗 Log URL: ${logUrl}`);
|
|
750
777
|
await log(` 📊 Log size: ${Math.round(logStats.size / 1024)}KB`);
|
|
751
778
|
return true;
|
|
@@ -785,7 +812,7 @@ ${sessionNote}
|
|
|
785
812
|
*/
|
|
786
813
|
async function attachRegularComment(options, logComment) {
|
|
787
814
|
const fs = (await use('fs')).promises;
|
|
788
|
-
const { targetType, targetNumber, owner, repo, $, log, logFile } = options;
|
|
815
|
+
const { targetType, targetNumber, owner, repo, $, log, logFile, errorMessage, errorDuringExecution, isUsageLimit } = options;
|
|
789
816
|
|
|
790
817
|
const targetName = targetType === 'pr' ? 'Pull Request' : 'Issue';
|
|
791
818
|
const ghCommand = targetType === 'pr' ? 'pr' : 'issue';
|
|
@@ -801,7 +828,8 @@ async function attachRegularComment(options, logComment) {
|
|
|
801
828
|
await fs.unlink(tempFile).catch(() => {});
|
|
802
829
|
|
|
803
830
|
if (posted.ok) {
|
|
804
|
-
|
|
831
|
+
const status = getLogUploadTerminalStatus({ errorMessage, errorDuringExecution, isUsageLimit });
|
|
832
|
+
await log(` ${status.emoji} ${status.label} uploaded to ${targetName} as comment${posted.commentId ? ` (id=${posted.commentId})` : ''}`);
|
|
805
833
|
await log(` 📊 Log size: ${Math.round(logStats.size / 1024)}KB`);
|
|
806
834
|
return true;
|
|
807
835
|
} else {
|
package/src/solve.mjs
CHANGED
|
@@ -1124,7 +1124,7 @@ try {
|
|
|
1124
1124
|
});
|
|
1125
1125
|
|
|
1126
1126
|
if (logUploadSuccess) {
|
|
1127
|
-
await log(`
|
|
1127
|
+
await log(` 📎 Failure logs attached to ${logTargetLabel}`);
|
|
1128
1128
|
} else {
|
|
1129
1129
|
// Issue #1212: Always show log upload failures (not just verbose)
|
|
1130
1130
|
await log(' ⚠️ Failed to upload failure logs');
|