next-issue 6.6.80 → 6.6.82
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 +8 -2
- package/dist/agents.mjs +10 -0
- package/dist/handover.mjs +6 -4
- package/dist/pending.mjs +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -176,7 +176,11 @@ the run handles one issue. For each issue:
|
|
|
176
176
|
times. When the checks pass, the harness marks the state file as closing,
|
|
177
177
|
sets `status:done` and closes the issue. When a run stops or dies before
|
|
178
178
|
the close, the next run sees the mark, sets `status:done` and closes the
|
|
179
|
-
issue, with no new push, revert or hand-over.
|
|
179
|
+
issue, with no new push, revert or hand-over. When a run stops or dies
|
|
180
|
+
after the close, before the state file goes away, the next run finds the
|
|
181
|
+
closed issue through its state file and removes the worktree, the local
|
|
182
|
+
branches and the state file, with no new push, revert, label, close or
|
|
183
|
+
hand-over. A label or close that fails
|
|
180
184
|
for another reason hands the issue over, and it then waits for a person
|
|
181
185
|
like any other hand-over. Then the harness fetches the remote and
|
|
182
186
|
fast-forwards the local base branch to the landed commit when that is
|
|
@@ -425,7 +429,9 @@ Three levels of console output:
|
|
|
425
429
|
and the tools of your extensions. The reviewer gets all of them except
|
|
426
430
|
`edit` and `write`. The agents run with `GIT_OPTIONAL_LOCKS=0`, so a
|
|
427
431
|
`git status` from an agent or an extension does not hold the index lock
|
|
428
|
-
while the harness commits.
|
|
432
|
+
while the harness commits. While an agent runs, `process.argv[1]` is the
|
|
433
|
+
pi CLI, so an extension that starts a child pi with `process.execPath` and
|
|
434
|
+
`process.argv[1]` (such as a `subagent` tool) runs pi, not next-issue.
|
|
429
435
|
|
|
430
436
|
## Configuration
|
|
431
437
|
|
package/dist/agents.mjs
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
1
4
|
import { getAgentDir, } from '@earendil-works/pi-coding-agent';
|
|
2
5
|
import { openSession } from './agent-session.mjs';
|
|
3
6
|
import { onStop, refuseWhenStopped } from './children.mjs';
|
|
@@ -10,11 +13,18 @@ export const REVIEWING = {
|
|
|
10
13
|
export const CODING = {
|
|
11
14
|
tools: ['+grep', '+find', '+ls'],
|
|
12
15
|
};
|
|
16
|
+
const PI_CLI = piCli();
|
|
17
|
+
function piCli() {
|
|
18
|
+
const root = dirname(dirname(fileURLToPath(import.meta.resolve('@earendil-works/pi-coding-agent'))));
|
|
19
|
+
const manifest = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8'));
|
|
20
|
+
return join(root, manifest.bin.pi);
|
|
21
|
+
}
|
|
13
22
|
export async function runAgent(recorder, request) {
|
|
14
23
|
const log = recorder.scope({ role: request.name });
|
|
15
24
|
const agentDir = request.runtime?.agentDir ?? getAgentDir();
|
|
16
25
|
const started = Date.now();
|
|
17
26
|
process.env.GIT_OPTIONAL_LOCKS = '0';
|
|
27
|
+
process.argv[1] = PI_CLI;
|
|
18
28
|
log.event('agent.start', { model: request.model, timeoutMs: request.timeoutMs });
|
|
19
29
|
const session = await openSession(recorder, log, request, agentDir);
|
|
20
30
|
const timer = deadline(request.timeoutMs, () => void session.abort());
|
package/dist/handover.mjs
CHANGED
|
@@ -28,10 +28,12 @@ export async function escalateAndFinish(job, note, reason) {
|
|
|
28
28
|
}
|
|
29
29
|
export async function finishDone(job) {
|
|
30
30
|
const { context, issue } = job;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
if (issue.closed !== true) {
|
|
32
|
+
job.state.closing = true;
|
|
33
|
+
await writeState(context.repo, job.state);
|
|
34
|
+
await setStatus(context, issue.number, context.config.labels.done);
|
|
35
|
+
await context.ports.closeIssue(context.repo, issue.number);
|
|
36
|
+
}
|
|
35
37
|
await updateLocalBase(job);
|
|
36
38
|
return { done: true, report: await finish(job, 'done') };
|
|
37
39
|
}
|
package/dist/pending.mjs
CHANGED
|
@@ -33,6 +33,9 @@ async function savedIssue(context, number) {
|
|
|
33
33
|
if (saved === 'broken' || open) {
|
|
34
34
|
return { open, issue };
|
|
35
35
|
}
|
|
36
|
+
if (saved?.closing === true && saved.handedOver !== true) {
|
|
37
|
+
return { open, issue: { ...issue, closed: true } };
|
|
38
|
+
}
|
|
36
39
|
return { open };
|
|
37
40
|
}
|
|
38
41
|
catch (error) {
|