@link-assistant/hive-mind 1.2.7 â 1.2.9
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 +19 -0
- package/package.json +1 -1
- package/src/agent.lib.mjs +7 -1
- package/src/solve.branch.lib.mjs +9 -9
- package/src/solve.mjs +3 -0
- package/src/solve.repository.lib.mjs +35 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @link-assistant/hive-mind
|
|
2
2
|
|
|
3
|
+
## 1.2.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b5e047a: Fix branch checkout error showing null/null instead of actual repository URL
|
|
8
|
+
- Pass owner/repo/prNumber to branch error handlers for accurate error messages
|
|
9
|
+
- Add upstream remote fallback when PR branch not found in origin (handles bot PRs)
|
|
10
|
+
- Add case study documentation for issue #1120
|
|
11
|
+
|
|
12
|
+
## 1.2.8
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Add case study for issue #1114 analyzing AI solver performance in hyoo-ru/mam_mol repository
|
|
17
|
+
|
|
18
|
+
fix: Propagate --verbose flag to agent tool for debugging DecimalError issues
|
|
19
|
+
- Added --verbose flag propagation to agent tool execution in agent.lib.mjs
|
|
20
|
+
- Created case study documentation for DecimalError root cause analysis
|
|
21
|
+
|
|
3
22
|
## 1.2.7
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/package.json
CHANGED
package/src/agent.lib.mjs
CHANGED
|
@@ -364,6 +364,11 @@ export const executeAgentCommand = async params => {
|
|
|
364
364
|
// Build agent command arguments
|
|
365
365
|
let agentArgs = `--model ${mappedModel}`;
|
|
366
366
|
|
|
367
|
+
// Propagate verbose flag to agent for detailed debugging output
|
|
368
|
+
if (argv.verbose) {
|
|
369
|
+
agentArgs += ' --verbose';
|
|
370
|
+
}
|
|
371
|
+
|
|
367
372
|
// Agent supports stdin in both plain text and JSON format
|
|
368
373
|
// We'll combine system and user prompts into a single message
|
|
369
374
|
const combinedPrompt = systemPrompt ? `${systemPrompt}\n\n${prompt}` : prompt;
|
|
@@ -382,10 +387,11 @@ export const executeAgentCommand = async params => {
|
|
|
382
387
|
|
|
383
388
|
try {
|
|
384
389
|
// Pipe the prompt file to agent via stdin
|
|
390
|
+
// Use agentArgs which includes --model and optionally --verbose
|
|
385
391
|
execCommand = $({
|
|
386
392
|
cwd: tempDir,
|
|
387
393
|
mirror: false,
|
|
388
|
-
})`cat ${promptFile} | ${agentPath}
|
|
394
|
+
})`cat ${promptFile} | ${agentPath} ${agentArgs}`;
|
|
389
395
|
|
|
390
396
|
await log(`${formatAligned('đ', 'Command details:', '')}`);
|
|
391
397
|
await log(formatAligned('đ', 'Working directory:', tempDir, 2));
|
package/src/solve.branch.lib.mjs
CHANGED
|
@@ -100,7 +100,7 @@ export function detectBranchFormat(branchName) {
|
|
|
100
100
|
return null;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
export async function createOrCheckoutBranch({ isContinueMode, prBranch, issueNumber, tempDir, defaultBranch, argv, log, formatAligned, $, crypto }) {
|
|
103
|
+
export async function createOrCheckoutBranch({ isContinueMode, prBranch, issueNumber, tempDir, defaultBranch, argv, log, formatAligned, $, crypto, owner, repo, prNumber }) {
|
|
104
104
|
// Create a branch for the issue or checkout existing PR branch
|
|
105
105
|
let branchName;
|
|
106
106
|
let checkoutResult;
|
|
@@ -136,11 +136,11 @@ export async function createOrCheckoutBranch({ isContinueMode, prBranch, issueNu
|
|
|
136
136
|
const { handleBranchCheckoutError } = branchErrors;
|
|
137
137
|
await handleBranchCheckoutError({
|
|
138
138
|
branchName,
|
|
139
|
-
prNumber
|
|
139
|
+
prNumber,
|
|
140
140
|
errorOutput,
|
|
141
141
|
issueUrl: argv['issue-url'] || argv._[0],
|
|
142
|
-
owner
|
|
143
|
-
repo
|
|
142
|
+
owner,
|
|
143
|
+
repo,
|
|
144
144
|
tempDir,
|
|
145
145
|
argv,
|
|
146
146
|
formatAligned,
|
|
@@ -154,8 +154,8 @@ export async function createOrCheckoutBranch({ isContinueMode, prBranch, issueNu
|
|
|
154
154
|
branchName,
|
|
155
155
|
errorOutput,
|
|
156
156
|
tempDir,
|
|
157
|
-
owner
|
|
158
|
-
repo
|
|
157
|
+
owner,
|
|
158
|
+
repo,
|
|
159
159
|
formatAligned,
|
|
160
160
|
log,
|
|
161
161
|
});
|
|
@@ -193,9 +193,9 @@ export async function createOrCheckoutBranch({ isContinueMode, prBranch, issueNu
|
|
|
193
193
|
isContinueMode,
|
|
194
194
|
branchName,
|
|
195
195
|
actualBranch,
|
|
196
|
-
prNumber
|
|
197
|
-
owner
|
|
198
|
-
repo
|
|
196
|
+
prNumber,
|
|
197
|
+
owner,
|
|
198
|
+
repo,
|
|
199
199
|
tempDir,
|
|
200
200
|
formatAligned,
|
|
201
201
|
log,
|
package/src/solve.mjs
CHANGED
|
@@ -1208,6 +1208,41 @@ export const checkoutPrBranch = async (tempDir, branchName, prForkRemote, prFork
|
|
|
1208
1208
|
} else {
|
|
1209
1209
|
// Branch doesn't exist locally, try to checkout from remote
|
|
1210
1210
|
checkoutResult = await $({ cwd: tempDir })`git checkout -b ${branchName} ${remoteName}/${branchName}`;
|
|
1211
|
+
|
|
1212
|
+
// If checkout from origin failed, try upstream remote as fallback
|
|
1213
|
+
// This handles the case where we're in fork mode but the PR branch exists in upstream
|
|
1214
|
+
// (e.g., a bot created PR in the upstream repo, not a fork PR)
|
|
1215
|
+
if (checkoutResult.code !== 0 && remoteName === 'origin') {
|
|
1216
|
+
await log(`${formatAligned('đ', 'Branch not in origin:', 'Checking upstream remote...')}`);
|
|
1217
|
+
|
|
1218
|
+
// Check if upstream remote exists
|
|
1219
|
+
const upstreamCheckResult = await $({ cwd: tempDir })`git remote get-url upstream 2>/dev/null`;
|
|
1220
|
+
if (upstreamCheckResult.code === 0) {
|
|
1221
|
+
// Fetch from upstream to ensure we have the latest branches
|
|
1222
|
+
await log(`${formatAligned('đĨ', 'Fetching from upstream:', 'Looking for PR branch...')}`);
|
|
1223
|
+
const fetchUpstreamResult = await $({ cwd: tempDir })`git fetch upstream`;
|
|
1224
|
+
|
|
1225
|
+
if (fetchUpstreamResult.code === 0) {
|
|
1226
|
+
// Check if branch exists in upstream
|
|
1227
|
+
const upstreamBranchCheckResult = await $({ cwd: tempDir })`git show-ref --verify --quiet refs/remotes/upstream/${branchName}`;
|
|
1228
|
+
|
|
1229
|
+
if (upstreamBranchCheckResult.code === 0) {
|
|
1230
|
+
await log(`${formatAligned('â
', 'Found branch in upstream:', `upstream/${branchName}`)}`);
|
|
1231
|
+
// Try to checkout from upstream instead
|
|
1232
|
+
checkoutResult = await $({ cwd: tempDir })`git checkout -b ${branchName} upstream/${branchName}`;
|
|
1233
|
+
|
|
1234
|
+
if (checkoutResult.code === 0) {
|
|
1235
|
+
await log(`${formatAligned('âšī¸', 'Note:', 'PR branch was in upstream repository, not your fork')}`);
|
|
1236
|
+
await log(`${formatAligned('', '', 'This can happen when a bot creates a PR directly in the main repository')}`);
|
|
1237
|
+
}
|
|
1238
|
+
} else {
|
|
1239
|
+
await log(`${formatAligned('â ī¸', 'Branch not found:', `Not in origin or upstream remotes`)}`, { level: 'warning' });
|
|
1240
|
+
}
|
|
1241
|
+
} else {
|
|
1242
|
+
await log(`${formatAligned('â ī¸', 'Warning:', 'Failed to fetch from upstream')}`, { level: 'warning' });
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1211
1246
|
}
|
|
1212
1247
|
|
|
1213
1248
|
return checkoutResult;
|