@link-assistant/hive-mind 2.11.2 → 2.11.4
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 +12 -0
- package/package.json +1 -1
- package/src/agent-commander.lib.mjs +33 -12
- package/src/agent-token-usage.lib.mjs +5 -9
- package/src/agent.lib.mjs +110 -152
- package/src/ai-tool-scratch.lib.mjs +143 -0
- package/src/anthropic-cost-accumulator.lib.mjs +36 -0
- package/src/auto-restart-budget.lib.mjs +107 -0
- package/src/auto-restart-exhaustion.lib.mjs +122 -0
- package/src/claude.lib.mjs +19 -15
- package/src/claude.runtime-switch.lib.mjs +4 -4
- package/src/codex.lib.mjs +46 -8
- package/src/credential-sanitization-core.lib.mjs +27 -3
- package/src/formal-ai-pricing.lib.mjs +110 -0
- package/src/gemini.lib.mjs +34 -43
- package/src/github-cost-info.lib.mjs +5 -0
- package/src/json-stream.lib.mjs +219 -0
- package/src/opencode.lib.mjs +56 -74
- package/src/pull-request-changes.lib.mjs +166 -0
- package/src/qwen.lib.mjs +33 -32
- package/src/reviewers-hive.mjs +2 -2
- package/src/solve.auto-merge.lib.mjs +68 -44
- package/src/solve.auto-pr.lib.mjs +11 -3
- package/src/solve.finalize.lib.mjs +15 -0
- package/src/solve.repository.lib.mjs +21 -4
- package/src/solve.restart-shared.lib.mjs +6 -2
- package/src/solve.results.lib.mjs +29 -16
- package/src/solve.watch.lib.mjs +47 -18
- package/src/use-m-bootstrap.lib.mjs +23 -4
- package/src/use-m-single-flight.lib.mjs +350 -0
- package/src/use-with-retry.lib.mjs +8 -2
- package/src/working-session-summary.lib.mjs +65 -0
- package/src/youtrack/youtrack-sync.mjs +2 -2
|
@@ -223,11 +223,17 @@ const defaultSleep = ms => new Promise(resolve => setTimeout(resolve, ms));
|
|
|
223
223
|
|
|
224
224
|
// Off by default so normal runs stay quiet; issue #2092 showed that when the
|
|
225
225
|
// loader dies there is no trace of which specifier or attempt failed.
|
|
226
|
+
// Issue #2113: both failing runs attached to the issue were started with
|
|
227
|
+
// `--verbose` and still produced zero loader diagnostics, so the log showed the
|
|
228
|
+
// final crash without a single line about which specifier, attempt or alias was
|
|
229
|
+
// involved. `--verbose` now opts into the same trace as HIVE_MIND_USE_M_DEBUG.
|
|
226
230
|
const defaultLog = message => {
|
|
227
|
-
if (process.env.HIVE_MIND_USE_M_DEBUG
|
|
231
|
+
if (process.env.HIVE_MIND_USE_M_DEBUG || process.argv.includes('--verbose')) {
|
|
232
|
+
console.error(`[use-m] ${message}`);
|
|
233
|
+
}
|
|
228
234
|
};
|
|
229
235
|
|
|
230
|
-
const USE_RETRY_WRAPPED = Symbol.for('hive-mind.use-with-retry.wrapped');
|
|
236
|
+
export const USE_RETRY_WRAPPED = Symbol.for('hive-mind.use-with-retry.wrapped');
|
|
231
237
|
|
|
232
238
|
/**
|
|
233
239
|
* Wrap a raw use-m `use` function so that *every* call site inherits the
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Issue #2119: make the published "Working session summary" comment honest.
|
|
5
|
+
*
|
|
6
|
+
* The Kotlin reproduction run ended with the AI tool answering a single `pwd`
|
|
7
|
+
* and returning, and Hive Mind published exactly that as the session's result:
|
|
8
|
+
*
|
|
9
|
+
* <!-- hive-mind:working-session-summary -->
|
|
10
|
+
* ## Working session summary
|
|
11
|
+
*
|
|
12
|
+
* The `pwd` command completed. Output:
|
|
13
|
+
*
|
|
14
|
+
* ```text
|
|
15
|
+
* /tmp/gh-issue-solver-1785421161275
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* (https://github.com/konard/test-hello-world-019fb330-fa49-7c9d-a664-b7ea33bb698a/pull/2#issuecomment-5132013034)
|
|
19
|
+
*
|
|
20
|
+
* Two things are wrong with that comment, and both are Hive Mind's to fix - the
|
|
21
|
+
* tool returning nothing useful is a separate, upstream problem:
|
|
22
|
+
*
|
|
23
|
+
* 1. It reads as a report of completed work. A reader has to open the diff to
|
|
24
|
+
* discover the pull request is still empty. Stating that in the comment
|
|
25
|
+
* turns a misleading summary into an accurate one.
|
|
26
|
+
* 2. It publishes the solver's private workspace path. That path is an
|
|
27
|
+
* implementation detail of the machine the run happened on; it is noise in
|
|
28
|
+
* a public comment and it tells readers about the host filesystem.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/** Solver workspace directories, as created by solve.repository.lib.mjs. */
|
|
32
|
+
const WORKSPACE_PATH_PATTERN = /(?:\/private)?\/(?:tmp|var\/folders\/[^\s/]+\/[^\s/]+\/[^\s/]+)\/gh-issue-solver(?:-resume)?-[A-Za-z0-9._-]+/g;
|
|
33
|
+
|
|
34
|
+
/** Replacement shown in place of a redacted workspace path. */
|
|
35
|
+
export const WORKSPACE_PATH_PLACEHOLDER = '<workspace>';
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Replace solver workspace paths with a placeholder.
|
|
39
|
+
*
|
|
40
|
+
* Only the solver's own `gh-issue-solver-*` directories are touched: paths the
|
|
41
|
+
* user actually cares about (repository-relative paths, other absolute paths)
|
|
42
|
+
* are left exactly as the AI wrote them.
|
|
43
|
+
*
|
|
44
|
+
* @param {string} text
|
|
45
|
+
* @returns {string}
|
|
46
|
+
*/
|
|
47
|
+
export const redactWorkspacePaths = text => {
|
|
48
|
+
if (typeof text !== 'string' || !text) return text;
|
|
49
|
+
return text.replace(WORKSPACE_PATH_PATTERN, WORKSPACE_PATH_PLACEHOLDER);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The line appended when the pull request still has an empty diff.
|
|
54
|
+
*
|
|
55
|
+
* @param {{measured: boolean, hasChanges: boolean}|null} changeStats - from
|
|
56
|
+
* `getPullRequestChangeStats`; `null` or unmeasured stats produce no notice,
|
|
57
|
+
* so a failed diff read never turns into a false "no changes" claim.
|
|
58
|
+
* @returns {string} the notice, or an empty string when none applies
|
|
59
|
+
*/
|
|
60
|
+
export const buildNoChangesNotice = changeStats => {
|
|
61
|
+
if (!changeStats || !changeStats.measured || changeStats.hasChanges) return '';
|
|
62
|
+
return '> ⚠️ This pull request still contains no changes - nothing was implemented yet.';
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export default { buildNoChangesNotice, redactWorkspacePaths, WORKSPACE_PATH_PLACEHOLDER };
|
|
@@ -101,7 +101,7 @@ ${youTrackIssue.description || 'No description provided.'}
|
|
|
101
101
|
if (needsUpdate) {
|
|
102
102
|
await log(` 📝 Updating issue #${existingIssue.number} for ${youTrackId}...`);
|
|
103
103
|
|
|
104
|
-
const updateResult = await $`gh issue edit ${existingIssue.number} --repo ${owner}/${repo} --title
|
|
104
|
+
const updateResult = await $`gh issue edit ${existingIssue.number} --repo ${owner}/${repo} --title ${ghTitle} --body ${ghBody}`;
|
|
105
105
|
|
|
106
106
|
if (updateResult.code === 0) {
|
|
107
107
|
await log(` ✅ Updated issue #${existingIssue.number}`);
|
|
@@ -130,7 +130,7 @@ ${youTrackIssue.description || 'No description provided.'}
|
|
|
130
130
|
await log(` ➕ Creating GitHub issue for ${youTrackId}...`);
|
|
131
131
|
|
|
132
132
|
try {
|
|
133
|
-
const createResult = await $`gh issue create --repo ${owner}/${repo} --title
|
|
133
|
+
const createResult = await $`gh issue create --repo ${owner}/${repo} --title ${ghTitle} --body ${ghBody} --label "help wanted"`;
|
|
134
134
|
|
|
135
135
|
if (createResult.code === 0) {
|
|
136
136
|
const issueUrl = createResult.stdout.toString().trim();
|