next-issue 2.17.0 → 2.18.0

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/fix.mjs CHANGED
@@ -4,16 +4,19 @@ import { message } from './observe.mjs';
4
4
  import { fixPrompt, hookPrompt, parseCommitSubject, parseUnrelated, } from './prompts.mjs';
5
5
  import { writeState } from './state.mjs';
6
6
  export async function fixRound(job, reason, detail, earlier, kind, force = false, from) {
7
- const { context, issue, log, worktree, branch } = job;
8
- const { ports } = context;
7
+ const { context, issue, log, state, worktree, branch } = job;
8
+ const { ports, config } = context;
9
9
  const before = from ?? (await ports.revision(worktree));
10
- const result = await log.step('fix', { reason }, () => ports.runAgent(log, {
10
+ const budget = kind === 'review'
11
+ ? { round: state.reviewRounds, limit: config.maxReviewRounds }
12
+ : { round: state.ciFixes, limit: config.maxCiFixes };
13
+ const result = await log.step('fix', { reason, cause: kind, ...budget }, () => ports.runAgent(log, {
11
14
  name: 'fixer',
12
15
  cwd: worktree,
13
16
  prompt: fixPrompt(issue, reason, detail, earlier, kind, job.reply),
14
17
  profile: CODING,
15
- model: context.config.models.fixer,
16
- timeoutMs: context.config.agentTimeoutMinutes * 60_000,
18
+ model: config.models.fixer,
19
+ timeoutMs: config.agentTimeoutMinutes * 60_000,
17
20
  }));
18
21
  const unrelated = parseUnrelated(result.text);
19
22
  if (unrelated !== undefined) {
@@ -33,7 +36,7 @@ export async function fixRound(job, reason, detail, earlier, kind, force = false
33
36
  log.event('commit.empty', { reason }, 'quiet');
34
37
  return { committed: false };
35
38
  }
36
- await ports.push(worktree, context.config.remote, branch, force);
39
+ await ports.push(worktree, config.remote, branch, force);
37
40
  return { committed: true };
38
41
  }
39
42
  export async function commitWork(job, before, subject, role) {
@@ -59,7 +62,7 @@ export async function commitWork(job, before, subject, role) {
59
62
  await writeState(repo, state);
60
63
  const output = message(error).slice(-config.logMaxChars);
61
64
  log.event('commit.fail', { role, output }, 'quiet');
62
- const fix = await log.step('commit-fix', { role }, () => ports.runAgent(log, {
65
+ const fix = await log.step('commit-fix', { role, round: state.commitFixes, limit: config.maxCommitFixes }, () => ports.runAgent(log, {
63
66
  name: role,
64
67
  cwd: worktree,
65
68
  prompt: hookPrompt(issue, comments, role, output),
package/dist/progress.mjs CHANGED
@@ -9,6 +9,20 @@ function toolLine(record) {
9
9
  const line = typeof command === 'string' ? `${tool} ${command.split('\n')[0]}` : tool;
10
10
  return line.length > TOOL_LINE_MAX ? `${line.slice(0, TOOL_LINE_MAX - 1)}…` : line;
11
11
  }
12
+ function stageOf(step, record) {
13
+ const cause = record['cause'];
14
+ const name = step === 'fix' && typeof cause === 'string'
15
+ ? `${cause} fix`
16
+ : step === 'commit-fix'
17
+ ? 'commit fix'
18
+ : step;
19
+ const round = record['round'];
20
+ const limit = record['limit'];
21
+ if (typeof round !== 'number') {
22
+ return name;
23
+ }
24
+ return typeof limit === 'number' ? `${name} ${round}/${limit}` : `${name} ${round}`;
25
+ }
12
26
  function change(progress, issue, update) {
13
27
  return {
14
28
  ...progress,
@@ -45,16 +59,15 @@ export function applyEvent(progress, record) {
45
59
  const issues = progress.issues.filter((current) => current.issue !== issue);
46
60
  return { ...progress, issues, handled };
47
61
  }
62
+ if (kind === 'issues') {
63
+ return { ...progress, open: Number(record['open']) };
64
+ }
48
65
  if (kind === 'issues.fail') {
49
66
  return { ...progress, error: String(record['error']) };
50
67
  }
51
68
  if (kind.endsWith('.start') && !NOT_STAGES.has(kind)) {
52
- const stage = kind.slice(0, -'.start'.length);
53
- const round = record['round'];
54
- return change(progress, issue, (current) => ({
55
- ...current,
56
- stage: typeof round === 'number' ? `${stage} ${round}` : stage,
57
- }));
69
+ const stage = stageOf(kind.slice(0, -'.start'.length), record);
70
+ return change(progress, issue, (current) => ({ ...current, stage }));
58
71
  }
59
72
  return progress;
60
73
  }
package/dist/review.mjs CHANGED
@@ -22,6 +22,7 @@ export async function reviewRound(job) {
22
22
  const patch = capDiff(full, config.diffMaxChars);
23
23
  const fields = {
24
24
  round: state.reviewRounds,
25
+ limit: config.maxReviewRounds,
25
26
  diffChars: full.length,
26
27
  cut: full.length > config.diffMaxChars,
27
28
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "2.17.0",
3
+ "version": "2.18.0",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",