@yemi33/minions 0.1.692 → 0.1.694
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/engine/ado.js +22 -6
- package/engine/lifecycle.js +7 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/engine/ado.js
CHANGED
|
@@ -99,16 +99,32 @@ const BUILD_ERROR_LOG_MAX_LINES = 150;
|
|
|
99
99
|
* for failed tasks, and fetches their logs.
|
|
100
100
|
* Returns truncated log text or null if unavailable.
|
|
101
101
|
*/
|
|
102
|
-
async function fetchAdoBuildErrorLog(orgBase, project, failedStatus, token) {
|
|
102
|
+
async function fetchAdoBuildErrorLog(orgBase, project, failedStatus, token, pr) {
|
|
103
103
|
try {
|
|
104
|
-
//
|
|
104
|
+
// Try extracting buildId from targetUrl (e.g. .../_build/results?buildId=12345)
|
|
105
105
|
const targetUrl = failedStatus?.targetUrl || '';
|
|
106
|
+
let buildId = null;
|
|
106
107
|
const buildIdMatch = targetUrl.match(/buildId=(\d+)/);
|
|
107
|
-
if (
|
|
108
|
-
|
|
108
|
+
if (buildIdMatch) {
|
|
109
|
+
buildId = buildIdMatch[1];
|
|
110
|
+
} else {
|
|
111
|
+
// Fallback: query recent failed builds for this PR's source branch
|
|
112
|
+
try {
|
|
113
|
+
const branch = pr?.branch || pr?.sourceRefName?.replace('refs/heads/', '');
|
|
114
|
+
if (branch) {
|
|
115
|
+
const buildsUrl = `${orgBase}/${project.adoProject}/_apis/build/builds?branchName=refs/heads/${encodeURIComponent(branch)}&statusFilter=completed&resultFilter=failed&$top=1&api-version=7.1`;
|
|
116
|
+
const builds = await adoFetch(buildsUrl, token);
|
|
117
|
+
if (builds?.value?.[0]?.id) {
|
|
118
|
+
buildId = String(builds.value[0].id);
|
|
119
|
+
log('debug', `Found buildId ${buildId} via branch query for ${branch}`);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
} catch (e) { log('debug', `Branch-based build lookup failed: ${e.message}`); }
|
|
123
|
+
}
|
|
124
|
+
if (!buildId) {
|
|
125
|
+
log('debug', `No buildId from targetUrl or branch query: ${targetUrl.slice(0, 120)}`);
|
|
109
126
|
return null;
|
|
110
127
|
}
|
|
111
|
-
const buildId = buildIdMatch[1];
|
|
112
128
|
|
|
113
129
|
// Fetch build timeline to find failed tasks
|
|
114
130
|
const timelineUrl = `${orgBase}/${project.adoProject}/_apis/build/builds/${buildId}/timeline?api-version=7.1`;
|
|
@@ -375,7 +391,7 @@ async function pollPrStatus(config) {
|
|
|
375
391
|
// Fetch actual compiler/build error logs when transitioning to failing
|
|
376
392
|
if (buildStatus === 'failing') {
|
|
377
393
|
const failedStatusObj = buildStatuses.find(s => s.state === 'failed' || s.state === 'error');
|
|
378
|
-
const errorLog = await fetchAdoBuildErrorLog(orgBase, project, failedStatusObj, token);
|
|
394
|
+
const errorLog = await fetchAdoBuildErrorLog(orgBase, project, failedStatusObj, token, pr);
|
|
379
395
|
if (errorLog) {
|
|
380
396
|
pr.buildErrorLog = errorLog;
|
|
381
397
|
log('info', `PR ${pr.id}: fetched ${errorLog.split('\n').length} lines of build error log`);
|
package/engine/lifecycle.js
CHANGED
|
@@ -583,6 +583,13 @@ function syncPrsFromOutput(output, agentId, meta, config) {
|
|
|
583
583
|
while ((match = urlPattern.exec(text)) !== null) prMatches.add(match[1] || match[2]);
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
|
+
// Also scan assistant text blocks for PR URLs and "PR created" patterns
|
|
587
|
+
if (block.type === 'text' && block.text) {
|
|
588
|
+
while ((match = urlPattern.exec(block.text)) !== null) prMatches.add(match[1] || match[2]);
|
|
589
|
+
const textCreatedPattern = /(?:PR created|created PR|E2E PR)[:\s#-]*(\d{1,})/gi;
|
|
590
|
+
let m2;
|
|
591
|
+
while ((m2 = textCreatedPattern.exec(block.text)) !== null) prMatches.add(m2[1]);
|
|
592
|
+
}
|
|
586
593
|
}
|
|
587
594
|
if (parsed.type === 'result' && parsed.result) {
|
|
588
595
|
const resultText = parsed.result;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yemi33/minions",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.694",
|
|
4
4
|
"description": "Multi-agent AI dev team that runs from ~/.minions/ — five autonomous agents share a single engine, dashboard, and knowledge base",
|
|
5
5
|
"bin": {
|
|
6
6
|
"minions": "bin/minions.js"
|