next-issue 14.4.22 → 14.4.23

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.
@@ -125,7 +125,7 @@ async function claimIssues(loop, seen, tried, pool) {
125
125
  }
126
126
  seen.add(issue.number);
127
127
  const slot = pool.slots.claim();
128
- pool.running.set(issue.number, loop.process(issue, undefined, slot).then((report) => ({ issue: issue.number, slot, report }), (failure) => ({ issue: issue.number, slot, failure })));
128
+ pool.running.set(issue.number, loop.process(issue, slot).then((report) => ({ issue: issue.number, slot, report }), (failure) => ({ issue: issue.number, slot, failure })));
129
129
  }
130
130
  return { claiming: true, unclaimed: false };
131
131
  }
@@ -5,17 +5,16 @@ export async function watchIssues(watch) {
5
5
  const running = new Set();
6
6
  const failed = new Set();
7
7
  const ended = new AbortController();
8
- const claims = claimAlarm();
9
8
  const hunting = watch.hunter === undefined
10
9
  ? undefined
11
- : huntIssues(watch.hunter, watch.hunting ?? onOff(true), running, failed, claims, watch.issues, watch.refreshed, () => ended.signal.aborted || watch.stop(), ended.signal);
10
+ : huntIssues(watch.hunter, watch.hunting ?? onOff(true), running, failed, watch.issues, watch.refreshed, () => ended.signal.aborted || watch.stop(), ended.signal);
12
11
  try {
13
12
  return await watchPasses(failed, {
14
13
  ...watch,
15
- process: async (issue, _claimed, slot) => {
14
+ process: async (issue, slot) => {
16
15
  running.add(issue.number);
17
16
  try {
18
- const report = await watch.process(issue, claims.ring, slot);
17
+ const report = await watch.process(issue, slot);
19
18
  recordFailures(failed, [report]);
20
19
  return report;
21
20
  }
@@ -30,25 +29,6 @@ export async function watchIssues(watch) {
30
29
  await hunting;
31
30
  }
32
31
  }
33
- function claimAlarm() {
34
- let rung = false;
35
- let controller = new AbortController();
36
- return {
37
- ring: () => {
38
- rung = true;
39
- controller.abort();
40
- },
41
- take: () => {
42
- const was = rung;
43
- rung = false;
44
- return was;
45
- },
46
- signal: () => {
47
- controller = new AbortController();
48
- return controller.signal;
49
- },
50
- };
51
- }
52
32
  function aborted(signal) {
53
33
  return new Promise((resolve) => {
54
34
  if (signal.aborted) {
@@ -59,7 +39,7 @@ function aborted(signal) {
59
39
  }
60
40
  });
61
41
  }
62
- async function huntIssues(hunter, hunting, running, failed, claims, issues, refreshes, stopped, signal) {
42
+ async function huntIssues(hunter, hunting, running, failed, issues, refreshes, stopped, signal) {
63
43
  let step = 0;
64
44
  while (!stopped()) {
65
45
  if (!hunting.on()) {
@@ -71,7 +51,6 @@ async function huntIssues(hunter, hunting, running, failed, claims, issues, refr
71
51
  if (stopped()) {
72
52
  return;
73
53
  }
74
- claims.take();
75
54
  const waiting = ready?.filter((issue) => !running.has(issue.number)).length;
76
55
  if (waiting !== undefined && waiting < hunter.cap && hunting.on()) {
77
56
  if (await hunter.hunt(hunter.cap - waiting)) {
@@ -79,16 +58,16 @@ async function huntIssues(hunter, hunting, running, failed, claims, issues, refr
79
58
  await issues().catch(() => undefined);
80
59
  }
81
60
  }
82
- if (claims.take() || stopped() || !hunting.on()) {
61
+ if (stopped() || !hunting.on()) {
83
62
  continue;
84
63
  }
85
64
  const changed = hunting.changed();
86
65
  const refreshed = refreshes?.() ?? new AbortController().signal;
87
- await hunter.wait(backOffMinutes(step), AbortSignal.any([signal, claims.signal(), changed, refreshed]));
66
+ await hunter.wait(backOffMinutes(step), AbortSignal.any([signal, changed, refreshed]));
88
67
  if (changed.aborted || refreshed.aborted) {
89
68
  step = 0;
90
69
  }
91
- else if (!claims.take()) {
70
+ else {
92
71
  step += 1;
93
72
  }
94
73
  }
@@ -11,7 +11,7 @@ import { hasLabel } from '../shared/labels.mjs';
11
11
  import { newState, readState, resetState, } from '../shared/state.mjs';
12
12
  import { beforeBaseSettled } from '../shared/unsettled.mjs';
13
13
  import { setUp } from './worktree-setup.mjs';
14
- export async function processIssue(context, issue, claimed = () => undefined, slot) {
14
+ export async function processIssue(context, issue, slot) {
15
15
  const { repo } = context;
16
16
  const started = Date.now();
17
17
  const log = context.recorder.scope({ issue: issue.number });
@@ -35,7 +35,6 @@ export async function processIssue(context, issue, claimed = () => undefined, sl
35
35
  if (skip !== undefined) {
36
36
  return skip;
37
37
  }
38
- claimed();
39
38
  log.event('issue.start', { title: issue.title, createdAt: issue.createdAt });
40
39
  const state = startState(issue, saved, handedOver);
41
40
  let report;
@@ -47,7 +47,7 @@ async function handle(args, config, repo, recorder, controls) {
47
47
  const context = await startRun(args, config, repo, recorder, interrupts);
48
48
  const loop = {
49
49
  issues: () => pendingIssues(context),
50
- process: (issue, claimed, slot) => processIssue(context, issue, claimed, slot),
50
+ process: (issue, slot) => processIssue(context, issue, slot),
51
51
  stop: interrupts.afterIssue,
52
52
  concurrency: config.concurrency,
53
53
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "14.4.22",
3
+ "version": "14.4.23",
4
4
  "description": "Autonomous issue harness driven by the Claude Agent SDK",
5
5
  "keywords": [
6
6
  "github",