agents-relay 2.0.2 → 2.0.3

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.
@@ -2,6 +2,7 @@ import { applyJobGraphTarget, applyTaskGraphTarget } from './workflow/runtime.js
2
2
  import { jobLifecycleV2, taskLifecycleV2 } from './workflow/definitions-v2.js';
3
3
  import { dispatchWorkflowTargetOverride } from './workflow/dispatcher.js';
4
4
  import { dispatchTaskAction } from './task-actions.js';
5
+ import { applyJobCancelAction } from './job-actions.js';
5
6
  export function dashboardTaskAction(store, reconciler, action) {
6
7
  return async (jobId, taskId) => {
7
8
  const job = await store.load(jobId);
@@ -20,6 +21,12 @@ export function dashboardTaskAction(store, reconciler, action) {
20
21
  export function dashboardJobSetState(store) {
21
22
  return async (jobId, state) => {
22
23
  const job = await store.load(jobId);
24
+ if (state === 'CANCELLED') {
25
+ if (job.state !== 'CANCELLED')
26
+ await applyJobCancelAction(store, job);
27
+ await store.closePullRequest?.();
28
+ return await store.load(job.id);
29
+ }
23
30
  if (job.state === state)
24
31
  return job;
25
32
  await dispatchWorkflowTargetOverride(jobLifecycleV2, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agents-relay",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "Durable async agent jobs coordinated through GitHub pull requests",
5
5
  "type": "module",
6
6
  "bin": {