agents-relay 1.0.96 → 1.0.97

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.
@@ -30,6 +30,17 @@ function belongsToCurrentRun(job, task) {
30
30
  const slot = job.schedule?.currentRunSlot;
31
31
  return !slot || task.createdAt >= slot;
32
32
  }
33
+ const ACTIVE_RECOVERY_STATES = new Set(['DRAFT', 'QUEUED', 'RUNNING', 'BLOCKED']);
34
+ function recoveryTargetsTask(recovery, original) {
35
+ if (recovery.agentName !== 'troubleshooter')
36
+ return false;
37
+ if (recovery.parentTaskId)
38
+ return recovery.parentTaskId === original.id;
39
+ return recovery.id.startsWith(`troubleshoot-${slug(original.id)}-a`);
40
+ }
41
+ function hasActiveRecovery(job, original) {
42
+ return job.tasks.some(task => recoveryTargetsTask(task, original) && ACTIVE_RECOVERY_STATES.has(task.state));
43
+ }
33
44
  export function pendingTroubleshooterTasks(job) {
34
45
  const existing = new Set(job.tasks.filter(task => task.agentName === 'troubleshooter').map(task => task.id));
35
46
  const recoveries = [];
@@ -37,7 +48,7 @@ export function pendingTroubleshooterTasks(job) {
37
48
  if (!['FAILED', 'BLOCKED'].includes(task.state) || task.kind === 'planner' || task.agentName === 'troubleshooter' || !belongsToCurrentRun(job, task))
38
49
  continue;
39
50
  const id = troubleshooterTaskId(task);
40
- if (existing.has(id))
51
+ if (existing.has(id) || hasActiveRecovery(job, task))
41
52
  continue;
42
53
  const now = new Date().toISOString();
43
54
  recoveries.push({
@@ -48,7 +59,7 @@ export function pendingTroubleshooterTasks(job) {
48
59
  storySize: 'M',
49
60
  projectName: job.title,
50
61
  agentName: 'troubleshooter',
51
- parentTaskId: null,
62
+ parentTaskId: task.id,
52
63
  dependencies: [],
53
64
  capabilities: ['troubleshoot', 'recovery'],
54
65
  workerRequirements: { capabilities: ['model', 'local_repo', 'iterative_tools'], runtime: 'codex' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agents-relay",
3
- "version": "1.0.96",
3
+ "version": "1.0.97",
4
4
  "description": "Durable async agent jobs coordinated through GitHub pull requests",
5
5
  "type": "module",
6
6
  "bin": {