agents-relay 2.0.164 → 2.0.165
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/dist/pool.js +3 -0
- package/dist/reconciler.js +2 -7
- package/dist/troubleshooter.js +8 -0
- package/package.json +2 -2
package/dist/pool.js
CHANGED
|
@@ -6,6 +6,7 @@ import { ReconcileCoordinator } from './reconcile-coordinator.js';
|
|
|
6
6
|
import { errorMessage, observability, withObservabilityCorrelation } from './observability.js';
|
|
7
7
|
import { jobHasActiveExecution } from './job-execution-slot.js';
|
|
8
8
|
import { unblockNeedsNewPlan } from './unblock.js';
|
|
9
|
+
import { pendingTroubleshooterRetries } from './troubleshooter.js';
|
|
9
10
|
const RANK = { P0: 0, P1: 1, P2: 2, P3: 3 };
|
|
10
11
|
export function compareJobPriority(a, b) { return RANK[a.priority ?? 'P2'] - RANK[b.priority ?? 'P2'] || a.createdAt.localeCompare(b.createdAt) || a.id.localeCompare(b.id); }
|
|
11
12
|
export function runnableManagedJobs(items) { return items.filter(item => item.job.state === 'ACTIVE' || item.job.projectionRecovery?.status === 'repairing').map(item => item.job).sort(compareJobPriority); }
|
|
@@ -20,6 +21,8 @@ export function needsLifecycleReconciliation(job, now = Date.now()) {
|
|
|
20
21
|
return true;
|
|
21
22
|
if (job.executionMode === 'autonomous' && unblockNeedsNewPlan(job))
|
|
22
23
|
return true;
|
|
24
|
+
if (pendingTroubleshooterRetries(job).length > 0)
|
|
25
|
+
return true;
|
|
23
26
|
if (job.tasks.some(task => (task.state === 'QUEUED' && task.executionId === null)
|
|
24
27
|
|| (task.state === 'RUNNING' && task.adapter === 'orchestrator' && task.executionId === null)
|
|
25
28
|
|| (task.state === 'DRAFT' && task.dependencies.length > 0)))
|
package/dist/reconciler.js
CHANGED
|
@@ -26,7 +26,7 @@ import { executeManualPlan } from './manual-plan.js';
|
|
|
26
26
|
import { executionEventSource, withExecutionBoundary } from './reconciler-runtime.js';
|
|
27
27
|
export { executionEventSource } from './reconciler-runtime.js';
|
|
28
28
|
import { CallbackWorkflowEffectHandler } from './workflow/effects.js';
|
|
29
|
-
import { exhaustedTroubleshooterRecoveries, pendingTroubleshooterTasks, pendingTroubleshooterReopens, refreshTroubleshooterInput } from './troubleshooter.js';
|
|
29
|
+
import { exhaustedTroubleshooterRecoveries, pendingTroubleshooterTasks, pendingTroubleshooterReopens, pendingTroubleshooterRetries, refreshTroubleshooterInput } from './troubleshooter.js';
|
|
30
30
|
import { fallbackFailedTroubleshooters, escalateExhaustedTroubleshooters } from './troubleshooter-fallback.js';
|
|
31
31
|
import { taskUsesCanonicalProjectRun } from './workspace.js';
|
|
32
32
|
import { cleanupMergedJobWorktree } from './job-worktree-cleanup.js';
|
|
@@ -142,12 +142,7 @@ export class Reconciler extends ReconcilerReviewBase {
|
|
|
142
142
|
}
|
|
143
143
|
{
|
|
144
144
|
const recoveryJob = await this.store.load(jobId);
|
|
145
|
-
for (const recovery of recoveryJob
|
|
146
|
-
if (recovery.agentName !== 'troubleshooter' || recovery.state !== 'FAILED' || recovery.attempt >= recovery.maxAttempts)
|
|
147
|
-
continue;
|
|
148
|
-
const original = recoveryJob.tasks.find(task => task.id === recovery.parentTaskId);
|
|
149
|
-
if (!original || !['FAILED', 'BLOCKED'].includes(original.state))
|
|
150
|
-
continue;
|
|
145
|
+
for (const { original, recovery } of pendingTroubleshooterRetries(recoveryJob)) {
|
|
151
146
|
await applyTaskRetryAction(recovery);
|
|
152
147
|
recovery.routing = undefined;
|
|
153
148
|
recovery.workerSelection = undefined;
|
package/dist/troubleshooter.js
CHANGED
|
@@ -65,6 +65,14 @@ export function pendingTroubleshooterReopens(job) {
|
|
|
65
65
|
}
|
|
66
66
|
return pending;
|
|
67
67
|
}
|
|
68
|
+
export function pendingTroubleshooterRetries(job) {
|
|
69
|
+
return job.tasks.flatMap(recovery => {
|
|
70
|
+
if (recovery.agentName !== 'troubleshooter' || recovery.state !== 'FAILED' || recovery.attempt >= recovery.maxAttempts)
|
|
71
|
+
return [];
|
|
72
|
+
const original = job.tasks.find(task => task.id === recovery.parentTaskId);
|
|
73
|
+
return original && ['FAILED', 'BLOCKED'].includes(original.state) ? [{ original, recovery }] : [];
|
|
74
|
+
});
|
|
75
|
+
}
|
|
68
76
|
export function refreshTroubleshooterInput(job, original, recovery) {
|
|
69
77
|
recovery.input = failureInput(job, original, recovery.id);
|
|
70
78
|
recovery.recoveryForAttempt = original.attempt;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agents-relay",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.165",
|
|
4
4
|
"description": "Durable async agent jobs coordinated through GitHub pull requests",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"test:fast": "npm run build && node --import ./test/test-store-env.mjs --test --test-concurrency=2 test/workflow-lifecycle.test.js test/workflow-v2-lifecycle-parity.test.js test/workflow-effects.test.js test/relay-store.test.js test/local-authority.test.js test/local-jobid-routing.test.js test/local-sqlite-jobid.test.js test/no-github.test.js test/scheduled-jobs.test.js test/reconcile-coordinator.test.js test/service-publication.test.js test/github-webhook.test.js",
|
|
21
21
|
"test:full": "npm run build && node --import ./test/test-store-env.mjs --test --test-concurrency=1 test/*.test.js && npm run test:verification:l3",
|
|
22
22
|
"test:verification:l1": "npm run build && node --test test/verification/harness.test.mjs test/verification/contract.test.mjs test/verification/graph-inventory.test.mjs test/verification/dashboard-drilldown.test.mjs test/verification/evidence-matrix.test.mjs test/verification/task-resolution-classification.test.mjs test/verification/planner-contract.test.mjs test/verification/force-restate-validation.test.mjs test/planner-child-recovery.test.js",
|
|
23
|
-
"test:verification:l3": "npm run build && node --test --test-concurrency=1 test/verification/harness.test.mjs test/verification/l3-sqlite.test.mjs test/verification/l3-ingress.test.mjs test/verification/l3-replay.test.mjs test/verification/objective-authority.test.mjs test/verification/l3-convergence.test.mjs test/verification/l3-review-convergence.test.mjs test/verification/l3-human-escalation.test.mjs test/verification/l3-escalation-notifier.test.mjs test/verification/l3-unknown-effect.test.mjs test/verification/l3-cli-actions.test.mjs test/verification/l3-planner-round.test.mjs test/verification/l3-planner-cli.test.mjs test/verification/l3-task-resolution.test.mjs test/verification/l3-plan-apply-convergence.test.mjs test/verification/full-recovery-gates.test.mjs test/verification/production-wiring.test.mjs test/verification/l3-full-path.test.mjs test/verification/l3-projection-recovery.test.mjs",
|
|
23
|
+
"test:verification:l3": "npm run build && node --test --test-concurrency=1 test/verification/harness.test.mjs test/verification/l3-sqlite.test.mjs test/verification/l3-ingress.test.mjs test/verification/l3-replay.test.mjs test/verification/objective-authority.test.mjs test/verification/l3-convergence.test.mjs test/verification/l3-review-convergence.test.mjs test/verification/l3-human-escalation.test.mjs test/verification/l3-escalation-notifier.test.mjs test/verification/l3-unknown-effect.test.mjs test/verification/l3-cli-actions.test.mjs test/verification/l3-planner-round.test.mjs test/verification/l3-planner-cli.test.mjs test/verification/l3-task-resolution.test.mjs test/verification/l3-plan-apply-convergence.test.mjs test/verification/full-recovery-gates.test.mjs test/verification/production-wiring.test.mjs test/verification/l3-full-path.test.mjs test/verification/l3-projection-recovery.test.mjs test/verification/l3-daemon-startup-recovery.test.mjs",
|
|
24
24
|
"test:verification": "npm run test:verification:l1 && npm run test:verification:l2 && npm run test:verification:l3 && npm run test:verification:cross-a && node --test test/workflow-production-outbox.test.js && npm run test:verification:matrix",
|
|
25
25
|
"e2e": "node e2e/runner/run.mjs",
|
|
26
26
|
"test:verification:cross-a": "npm run build && RELAY_A_DIST=$PWD/dist node --test test/verification/action-ledger-cross-branch.test.mjs test/verification/outbox-cross-a.test.mjs",
|