next-issue 6.6.0 → 6.6.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/README.md CHANGED
@@ -278,7 +278,7 @@ Recorded for each step: `claim`, `comments`, `reply`, `worktree`, `setup`,
278
278
  `.start`, `.end` or `.error` event and a duration in `ms`. Every `git` and `gh`
279
279
  command is recorded with its exit code and duration. A `tool` event holds the
280
280
  tool name, and for a `bash` tool the command too. Each agent call adds a `usage`
281
- event with the tokens, the cost estimate in dollars, the turn count, the
281
+ event with the tokens, the turn count, the
282
282
  tool-call count, the model and the session id.
283
283
 
284
284
  ```bash
package/dist/agents.mjs CHANGED
@@ -57,7 +57,6 @@ function sessionResult(recorder, request, session, started) {
57
57
  toolCalls: stats.toolCalls,
58
58
  model: name,
59
59
  session: stats.sessionId,
60
- costUsd: stats.cost,
61
60
  });
62
61
  return {
63
62
  text: (session.getLastAssistantText() ?? '').trim(),
@@ -65,7 +64,6 @@ function sessionResult(recorder, request, session, started) {
65
64
  turns: stats.assistantMessages,
66
65
  toolCalls: stats.toolCalls,
67
66
  ms,
68
- costUsd: stats.cost,
69
67
  model: name,
70
68
  sessionId: stats.sessionId,
71
69
  };
package/dist/git-land.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { fetchBase, git, remoteRef, revision, succeeds } from './git.mjs';
1
+ import { fetchBase, git, oneFetchAtATime, remoteRef, revision, succeeds } from './git.mjs';
2
2
  import { commitEverything } from './git-commit.mjs';
3
3
  export const PUSH_TRIES = 3;
4
4
  export async function squashOnto(cwd, base, remote, message) {
@@ -18,7 +18,7 @@ export async function squashOnto(cwd, base, remote, message) {
18
18
  return true;
19
19
  }
20
20
  export async function pushToBase(cwd, remote, base) {
21
- return succeeds(cwd, ['push', remote, `HEAD:refs/heads/${base}`]);
21
+ return oneFetchAtATime(() => succeeds(cwd, ['push', remote, `HEAD:refs/heads/${base}`]));
22
22
  }
23
23
  export async function revertOnBase(cwd, revert) {
24
24
  const { branch } = revert;
package/dist/git.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import { must, optionalFlag, run, succeeded } from './exec.mjs';
2
+ import { oneAtATime } from './lock.mjs';
2
3
  import { lines } from './text.mjs';
3
4
  const REMOTE_PATTERNS = [
4
5
  /^git@[^:]+:(?<owner>[^/]+)\/(?<name>[^/]+?)(?:\.git)?$/,
@@ -64,12 +65,18 @@ export async function disputeBranches(repo, branch) {
64
65
  return lines(list);
65
66
  }
66
67
  export async function push(cwd, remote, branch, force = false) {
67
- await git(cwd, ['push', '-u', ...optionalFlag(force, '--force'), remote, branch]);
68
+ await oneFetchAtATime(() => git(cwd, ['push', '-u', ...optionalFlag(force, '--force'), remote, branch]));
68
69
  }
69
70
  export async function fetchBase(cwd, base, remote) {
70
- await git(cwd, ['fetch', remote, base]);
71
+ await gitFetch(cwd, [remote, base]);
71
72
  return remoteRef(remote, base);
72
73
  }
74
+ export function oneFetchAtATime(work) {
75
+ return oneAtATime('git fetch', work);
76
+ }
77
+ export function gitFetch(cwd, args) {
78
+ return oneFetchAtATime(() => git(cwd, ['fetch', ...args]));
79
+ }
73
80
  export async function resetToBase(cwd, base, remote) {
74
81
  const target = await fetchBase(cwd, base, remote);
75
82
  await git(cwd, ['reset', '--hard', target]);
package/dist/hunt.mjs CHANGED
@@ -4,7 +4,7 @@ import { setTimeout as delay } from 'node:timers/promises';
4
4
  import { REVIEWING } from './agents.mjs';
5
5
  import { minutesToMs } from './durations.mjs';
6
6
  import { readTextIfPresent } from './files.mjs';
7
- import { git, remoteRef, resetHard } from './git.mjs';
7
+ import { git, gitFetch, remoteRef, resetHard } from './git.mjs';
8
8
  import { oneAtATime } from './lock.mjs';
9
9
  import { huntPrompt } from './prompts.mjs';
10
10
  import { skipReason } from './skip.mjs';
@@ -14,7 +14,7 @@ const FILED = /^issue:\s*(\S+)\s*$/gm;
14
14
  export async function huntWorktree(repo, base, remote) {
15
15
  const path = join(repo.root, WORKTREE_DIR, 'hunt');
16
16
  const target = remoteRef(remote, base);
17
- await git(repo.root, ['fetch', remote]);
17
+ await gitFetch(repo.root, [remote]);
18
18
  await git(repo.root, ['worktree', 'prune']);
19
19
  if (existsSync(join(path, '.git'))) {
20
20
  await resetHard(path, target);
package/dist/worktree.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { join } from 'node:path';
2
- import { currentBranch, discardChanges, git, isAncestor, remoteRef, succeeds, } from './git.mjs';
2
+ import { currentBranch, discardChanges, git, gitFetch, isAncestor, oneFetchAtATime, remoteRef, succeeds, } from './git.mjs';
3
3
  export const WORKTREE_DIR = '.worktrees';
4
4
  function worktreePath(repo, issue) {
5
5
  return join(repo.root, WORKTREE_DIR, String(issue));
@@ -39,7 +39,7 @@ async function hasBranch(repo, name, ...flags) {
39
39
  return list.length > 0;
40
40
  }
41
41
  export async function fastForwardBase(repo, base, remote) {
42
- await git(repo.root, ['fetch', remote]);
42
+ await gitFetch(repo.root, [remote]);
43
43
  return updateBase(repo, base, remote);
44
44
  }
45
45
  async function updateBase(repo, base, remote) {
@@ -47,7 +47,7 @@ async function updateBase(repo, base, remote) {
47
47
  const args = (await currentBranch(repo.root)) === base
48
48
  ? ['merge', '--ff-only', remoteBase]
49
49
  : ['fetch', '.', `${remoteBase}:${base}`];
50
- return succeeds(repo.root, args);
50
+ return oneFetchAtATime(() => succeeds(repo.root, args));
51
51
  }
52
52
  export async function findWorktree(repo, branch) {
53
53
  const list = await git(repo.root, ['worktree', 'list', '--porcelain']);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "6.6.0",
3
+ "version": "6.6.2",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",