next-issue 6.6.86 → 6.6.88

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/README.md CHANGED
@@ -329,7 +329,8 @@ Press `Ctrl-C` to stop the run step by step:
329
329
  commit reached the base branch, the next run drops those edits and any
330
330
  unfinished merge of the base branch, then lands the change with no new
331
331
  review round. A hand-over of the issue cancels that approval, so the
332
- issue resumes in review.
332
+ issue resumes in review. A revert of the landed change cancels it too,
333
+ even when the hand-over after it does not finish.
333
334
 
334
335
  Signals that arrive within 100 ms of the last counted one count as one press,
335
336
  because `npx` and `npm exec` pass on a press as a second signal.
package/dist/exec.mjs CHANGED
@@ -7,6 +7,11 @@ let observer;
7
7
  const DEFAULT_TIMEOUT_MS = minutesToMs(10);
8
8
  const defaultTimeout = new AsyncLocalStorage();
9
9
  const STDERR_TAIL = 200_000;
10
+ // After the child exits, wait this long for `close`, which comes once both pipes have
11
+ // finished. A background process that inherited the pipes can keep them open, so `close`
12
+ // may never come. The fallback then waits one more poll phase before it closes the pipes,
13
+ // so output still in the pipes is read even when the event loop was busy past the wait.
14
+ const DRAIN_MS = 200;
10
15
  let shownCommands = 0;
11
16
  export function showingCommands() {
12
17
  return shownCommands > 0;
@@ -70,12 +75,14 @@ export function run(command, args, options = {}) {
70
75
  const output = collect(child, options);
71
76
  const timer = deadline(limit, () => killTree(child));
72
77
  let done = false;
78
+ let drain;
73
79
  let shown = options.show === true;
74
80
  if (shown) {
75
81
  shownCommands += 1;
76
82
  }
77
83
  const release = () => {
78
84
  timer.clear();
85
+ clearTimeout(drain);
79
86
  unwatch();
80
87
  if (shown) {
81
88
  shown = false;
@@ -98,12 +105,17 @@ export function run(command, args, options = {}) {
98
105
  reject(error);
99
106
  });
100
107
  child.on('exit', (code) => {
101
- if (!timer.timedOut()) {
108
+ const finish = () => {
109
+ child.stdout?.destroy();
110
+ child.stderr?.destroy();
111
+ settle(code);
112
+ };
113
+ if (timer.timedOut()) {
114
+ finish();
102
115
  return;
103
116
  }
104
- child.stdout?.destroy();
105
- child.stderr?.destroy();
106
- settle(code);
117
+ timer.clear();
118
+ drain = setTimeout(() => setImmediate(finish), DRAIN_MS);
107
119
  });
108
120
  child.on('close', settle);
109
121
  sendInput(child, options.input);
package/dist/revert.mjs CHANGED
@@ -31,6 +31,9 @@ export function restoreChange(state) {
31
31
  state.landed = undefined;
32
32
  state.title = state.changeTitle ?? state.title;
33
33
  state.changeTitle = undefined;
34
+ if (state.phase === 'approved') {
35
+ state.phase = 'review';
36
+ }
34
37
  }
35
38
  export async function revert(job) {
36
39
  const { context, issue, log, state, branch, worktree } = job;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "6.6.86",
3
+ "version": "6.6.88",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",