next-issue 14.1.0 → 14.1.2

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/pipeline.mjs CHANGED
@@ -6,7 +6,7 @@ import { claimedError, dropClosed, finishClosing, stop, stopNow } from './handov
6
6
  import { implement } from './implement.mjs';
7
7
  import { openJob } from './open-job.mjs';
8
8
  import { reviewRound, settleReview } from './review.mjs';
9
- import { skipReport, unclaimedError } from './skip.mjs';
9
+ import { closedReport, skipReport, unclaimedError } from './skip.mjs';
10
10
  import { hasLabel } from './labels.mjs';
11
11
  import { newState, readState, resetState, } from './state.mjs';
12
12
  import { beforeBaseSettled } from './unsettled.mjs';
@@ -28,7 +28,10 @@ export async function processIssue(context, issue, claimed = () => undefined, sl
28
28
  if (issue.closed === true && !closing) {
29
29
  return dropClosed(context, log, issue, saved?.branch ?? branchName(issue.number));
30
30
  }
31
- const skip = closing ? undefined : await skipReport(context, log, issue, saved, started);
31
+ const skip = closing
32
+ ? undefined
33
+ : ((await skipReport(context, log, issue, saved, started)) ??
34
+ (await closedReport(context, log, issue, saved, started)));
32
35
  if (skip !== undefined) {
33
36
  return skip;
34
37
  }
package/dist/serve.mjs CHANGED
@@ -76,6 +76,12 @@ export async function startWorker(options) {
76
76
  void close();
77
77
  }
78
78
  };
79
+ const idleTimeUp = () => {
80
+ if (polled()) {
81
+ idleTimer = setTimeout(idleTimeUp, idleMs - (Date.now() - polledAt));
82
+ }
83
+ closeWhenIdle();
84
+ };
79
85
  const upgradeBetweenIssues = (run) => {
80
86
  if (restart === undefined) {
81
87
  return;
@@ -233,7 +239,7 @@ export async function startWorker(options) {
233
239
  const answer = async (request, response) => {
234
240
  polledAt = Date.now();
235
241
  clearTimeout(idleTimer);
236
- idleTimer = setTimeout(closeWhenIdle, idleMs);
242
+ idleTimer = setTimeout(idleTimeUp, idleMs);
237
243
  const refusal = (text) => [
238
244
  { type: 'error', root: options.root, message: text },
239
245
  ];
@@ -270,7 +276,7 @@ export async function startWorker(options) {
270
276
  await listen(server, draft);
271
277
  await rename(draft, options.socketPath);
272
278
  owned.socket = fileId(options.socketPath);
273
- idleTimer = setTimeout(closeWhenIdle, idleMs);
279
+ idleTimer = setTimeout(idleTimeUp, idleMs);
274
280
  return { closed, close, release: () => removeOwned(owned) };
275
281
  }
276
282
  function upgradedRun(run) {
package/dist/skip.mjs CHANGED
@@ -1,8 +1,9 @@
1
1
  import { runStopped } from './children.mjs';
2
2
  import { elapsedMs } from './durations.mjs';
3
3
  import { message } from './errors.mjs';
4
+ import { branchName } from './git.mjs';
4
5
  import { handOverReply } from './hand-over-comments.mjs';
5
- import { stopNow } from './handover.mjs';
6
+ import { dropClosed, stopNow } from './handover.mjs';
6
7
  import { hasLabel } from './labels.mjs';
7
8
  import { heldByPerson, writeState } from './state.mjs';
8
9
  import { heldOnBase } from './unsettled.mjs';
@@ -74,6 +75,18 @@ export async function skipReport(context, log, issue, saved, started) {
74
75
  }
75
76
  return undefined;
76
77
  }
78
+ export async function closedReport(context, log, issue, saved, started) {
79
+ let open;
80
+ try {
81
+ ({ open } = await context.ports.viewIssue(context.repo, issue.number));
82
+ }
83
+ catch (error) {
84
+ return readError(log, issue, saved, error, started);
85
+ }
86
+ return open
87
+ ? undefined
88
+ : dropClosed(context, log, issue, saved?.branch ?? branchName(issue.number));
89
+ }
77
90
  /**
78
91
  * A person gave up on a halted issue: it never resumes to check the base while it has the skip label, so its halt
79
92
  * stops blocking the landings of other issues. The state keeps what is on the base for a later resume.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "14.1.0",
3
+ "version": "14.1.2",
4
4
  "description": "Autonomous issue harness driven by the Claude Agent SDK",
5
5
  "keywords": [
6
6
  "github",