agents-relay 2.0.257 → 2.0.259

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.
@@ -94,7 +94,10 @@ export class ReconcilerRuntimeBase {
94
94
  const latest = await this.store.load(event.job_id);
95
95
  const task = latest.tasks.find(item => item.id === event.task_id);
96
96
  if (task?.dagNode) {
97
- const projectPath = this.options.projectPathForJob ? await this.options.projectPathForJob(latest, task) : undefined;
97
+ // Use the Coordinator's durable checkout for DAG stage validation.
98
+ // An independent local repo need not resolve through generic workspace lookup.
99
+ const projectPath = latest.graphStartContext?.projectPath ??
100
+ (this.options.projectPathForJob ? await this.options.projectPathForJob(latest, task) : undefined);
98
101
  const invalid = await dagCompletionError(task, projectPath);
99
102
  if (invalid)
100
103
  return this.applyTerminalEvent({ ...event, type: 'task.failed',
@@ -432,7 +432,13 @@ export class Reconciler extends ReconcilerReviewBase {
432
432
  if (!reserved)
433
433
  throw new Error('already reserved launch attempt: reconcile existing generation');
434
434
  }
435
- const adapter = task.adapter === 'script' ? new ScriptTaskAdapter(event => this.options.eventBus ? this.emit(event) : this.handleEvent(event), this.options.executionContextRoots) : this.options.adapters.find(x => x.name === task.adapter);
435
+ const adapter = task.adapter === 'script' ? new ScriptTaskAdapter(async (event) => {
436
+ // Local Script Worker events must update Relay state even if an Event Bus
437
+ // subscriber is not attached to this Reconciler instance. Broadcasting
438
+ // alone is not an acknowledgement of a Task terminal transition.
439
+ await this.handleEvent(event);
440
+ await this.emit(event);
441
+ }, this.options.executionContextRoots) : this.options.adapters.find(x => x.name === task.adapter);
436
442
  if (!adapter) {
437
443
  await this.failLaunch(job.id, task.id, task.executionId, 'No adapter ' + task.adapter);
438
444
  return;
@@ -440,7 +446,8 @@ export class Reconciler extends ReconcilerReviewBase {
440
446
  let executionContext;
441
447
  try {
442
448
  const role = isFinalReviewAgent(task.agentName) ? 'reviewer' : task.agentName === 'troubleshooter' ? 'troubleshooter' : task.parentTaskId ? 'nested-worker' : 'worker';
443
- const projectPath = task.dagNode && job.graphStartContext?.projectPath ? job.graphStartContext.projectPath : this.options.projectPathForJob ? await this.options.projectPathForJob(job, task) : task.routing?.cwd ?? process.cwd();
449
+ const graphChild = Boolean(task.dagNode) || job.tasks.some(parent => parent.id === task.parentTaskId && Boolean(parent.dagNode));
450
+ const projectPath = graphChild && job.graphStartContext?.projectPath ? job.graphStartContext.projectPath : this.options.projectPathForJob ? await this.options.projectPathForJob(job, task) : task.routing?.cwd ?? process.cwd();
444
451
  executionContext = await this.resolvedContext(job, task, role, projectPath);
445
452
  }
446
453
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agents-relay",
3
- "version": "2.0.257",
3
+ "version": "2.0.259",
4
4
  "description": "Durable async agent jobs coordinated through GitHub pull requests",
5
5
  "repository": {
6
6
  "type": "git",