next-issue 6.6.66 → 6.6.68

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
@@ -257,7 +257,12 @@ and comments the reason on the issue, when:
257
257
  end. It halts this way even when the hand-over fails; the issue then ends
258
258
  in error with both the reason and the hand-over error;
259
259
  - an agent does not finish in `agentTimeoutMinutes`;
260
- - the setup command fails, or does not finish in `setupTimeoutMinutes`;
260
+ - the setup command fails, or does not finish in `setupTimeoutMinutes`. On a
261
+ resume whose state holds a landed commit, or a push or revert that may have
262
+ reached the base, the setup runs before the harness checks the base, so it
263
+ then also halts the run, with the commits and state kept for the next run.
264
+ The comment says what may be on the base and that its checks were not
265
+ awaited;
261
266
  - a step of the run fails with an error. A `gh` call that is safe to repeat,
262
267
  such as a read or a label edit, is tried up to three times first when the
263
268
  network fails. A `gh issue comment` is
@@ -394,7 +399,7 @@ Three levels of console output:
394
399
  call names the host of the remote url (`--repo <host>/<owner>/<name>`,
395
400
  `gh api --hostname <host>`) when it is not `github.com`, so `gh` must be
396
401
  logged in to that host. For an ssh url the harness reads the real host of an
397
- ssh alias with `ssh -G`. Other hosts, such as GitLab, are not supported.
402
+ ssh alias with `ssh -G`. The host `ssh.github.com` (GitHub's ssh over port 443) means `github.com`. Other hosts, such as GitLab, are not supported.
398
403
  - pi, logged in to a model provider. The agents use the model, the thinking
399
404
  level, the extensions and the skills from your pi settings, except the
400
405
  extension and the skills of `pi-next-issue`. The implementer and the fixer
package/dist/git.mjs CHANGED
@@ -6,12 +6,17 @@ const REMOTE_PATTERNS = [
6
6
  /^ssh:\/\/(?:[^@/]+@)?(?<host>[^@/:]+)(?::\d+)?\/(?<owner>[^/]+)\/(?<name>[^/]+?)(?:\.git)?\/?$/,
7
7
  /^https?:\/\/(?:[^@/]+@)?(?<host>[^@/:]+)(?::\d+)?\/(?<owner>[^/]+)\/(?<name>[^/]+?)(?:\.git)?\/?$/,
8
8
  ];
9
+ const GITHUB_SSH_HOST = 'ssh.github.com';
10
+ function githubHost(host) {
11
+ const lower = host.toLowerCase();
12
+ return lower === GITHUB_SSH_HOST ? 'github.com' : lower;
13
+ }
9
14
  export function parseRemote(url) {
10
15
  for (const pattern of REMOTE_PATTERNS) {
11
16
  const match = pattern.exec(url.trim());
12
17
  if (match?.groups) {
13
18
  return {
14
- host: match.groups.host.toLowerCase(),
19
+ host: githubHost(match.groups.host),
15
20
  owner: match.groups.owner,
16
21
  name: match.groups.name,
17
22
  };
@@ -26,7 +31,7 @@ async function sshHost(url, host) {
26
31
  const result = await run('ssh', ['-G', host]).catch(() => undefined);
27
32
  const resolved = /^hostname[^\S\r\n]+(\S+)$/m.exec(result?.stdout ?? '')?.[1];
28
33
  return result !== undefined && succeeded(result) && resolved !== undefined
29
- ? resolved.toLowerCase()
34
+ ? githubHost(resolved)
30
35
  : host;
31
36
  }
32
37
  export async function repoRoot(cwd) {
@@ -21,7 +21,25 @@ export async function setUp(job) {
21
21
  async function setupFailed(job, setup) {
22
22
  const late = setup.timedOut === true;
23
23
  job.log.event('setup.fail', { code: setup.code, timedOut: late, stderr: keepTail(setup.stderr.trim(), 2000) }, 'quiet');
24
- return escalateAndFinish(job, late
24
+ const unsettled = unsettledBase(job);
25
+ if (unsettled !== '') {
26
+ job.mainBroken = true;
27
+ }
28
+ const note = late
25
29
  ? `The setup command did not finish in ${job.context.config.setupTimeoutMinutes} minutes.`
26
- : 'The setup command failed in the worktree.', late ? 'setup timeout' : 'setup failed');
30
+ : 'The setup command failed in the worktree.';
31
+ return escalateAndFinish(job, `${note}${unsettled}`, late ? 'setup timeout' : 'setup failed');
32
+ }
33
+ function unsettledBase(job) {
34
+ const { landed, pushing, reverting } = job.state;
35
+ const base = `\`${job.context.base}\``;
36
+ const held = [
37
+ (landed ?? []).length > 0 ? `a landed commit is on ${base}` : '',
38
+ pushing === undefined ? '' : `a push may be on ${base}`,
39
+ reverting === undefined ? '' : `a revert may be on ${base}`,
40
+ ].filter((part) => part !== '');
41
+ if (held.length === 0) {
42
+ return '';
43
+ }
44
+ return ` This resume ran the setup before it checked the base: ${held.join(', ')}, and its checks were not awaited. The run halts, and the next run checks the base again.`;
27
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "6.6.66",
3
+ "version": "6.6.68",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",