@juanbenjumea/pi-agy 0.5.4 → 0.5.6
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/CHANGELOG.md +10 -0
- package/extensions/lib/cli.ts +8 -0
- package/extensions/lib/execute.ts +22 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.6
|
|
4
|
+
|
|
5
|
+
- Report user cancellations accurately when postflight is cut short: the diff-skip note no longer claims deadline expiry for user-initiated cancels (found in the final adversarial pass).
|
|
6
|
+
|
|
7
|
+
## 0.5.5
|
|
8
|
+
|
|
9
|
+
- Preserve completed responses past the deadline: a result that fully arrived before cancellation or timeout is returned with an explanatory note instead of being discarded — previously a kill landing between delivery and process exit threw the finished response away.
|
|
10
|
+
- Post-run steps cut short by the deadline (diff summary) are skipped with a note instead of failing the whole run after agy already finished.
|
|
11
|
+
- Persist the conversation under a fresh bounded signal on the success path too, so a save racing the deadline still records the resumable id.
|
|
12
|
+
|
|
3
13
|
## 0.5.4
|
|
4
14
|
|
|
5
15
|
- Fix pre-existing unstaged modifications being misattributed to agy: porcelain paths are now parsed by fixed column — `line.trim()` before `slice(3)` ate the path's first character for ` M` lines, so unstaged dirt never matched `diff --name-only` and always looked newly-dirty. Found by the agy plan-mode cross-review.
|
package/extensions/lib/cli.ts
CHANGED
|
@@ -1009,6 +1009,14 @@ function spawnAgyInternal(
|
|
|
1009
1009
|
runResult = processStreamLine(lineBuffer, runResult, onProgress);
|
|
1010
1010
|
}
|
|
1011
1011
|
|
|
1012
|
+
// A fully delivered result outranks the kill: when cancellation or
|
|
1013
|
+
// timeout lands after the response arrived, the work is done and the
|
|
1014
|
+
// response must not be discarded.
|
|
1015
|
+
if (runResult.response_complete) {
|
|
1016
|
+
resolve(finalizeRunResult(out, runResult));
|
|
1017
|
+
return;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1012
1020
|
if (sig === "SIGTERM" || sig === "SIGKILL" || code === null) {
|
|
1013
1021
|
reject(
|
|
1014
1022
|
withConversationId(
|
|
@@ -185,13 +185,19 @@ export async function executeAgyTask(
|
|
|
185
185
|
|
|
186
186
|
if (run.conversation_id) {
|
|
187
187
|
try {
|
|
188
|
-
|
|
188
|
+
// Fresh bounded signal: the composed one may already be aborted
|
|
189
|
+
// when the run finished at the deadline edge (see below).
|
|
190
|
+
await saveSession(
|
|
191
|
+
options.dir,
|
|
192
|
+
run.conversation_id,
|
|
193
|
+
effectiveModel,
|
|
194
|
+
AbortSignal.timeout(10_000),
|
|
195
|
+
);
|
|
189
196
|
} catch (error) {
|
|
190
197
|
const reason = error instanceof Error ? error.message : String(error);
|
|
191
198
|
onProgress?.(`agy: warning — could not persist session: ${reason}`);
|
|
192
199
|
}
|
|
193
200
|
}
|
|
194
|
-
remainingBudget(startedAt, options.timeout_ms);
|
|
195
201
|
|
|
196
202
|
let text = run.response;
|
|
197
203
|
const quotaSummary = quota?.models.length
|
|
@@ -200,16 +206,24 @@ export async function executeAgyTask(
|
|
|
200
206
|
if (quotaSummary) text = `${text}\n\n## agy quota snapshot\n${quotaSummary}`;
|
|
201
207
|
let changedFiles: string[] | undefined;
|
|
202
208
|
let preexistingFiles: string[] | undefined;
|
|
209
|
+
// The agy run itself is complete; from here, an expiring budget or a
|
|
210
|
+
// racing cancellation must never discard its response. Skip the
|
|
211
|
+
// post-run steps with a note instead of throwing the result away.
|
|
203
212
|
if (options.mode === "accept-edits") {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
213
|
+
try {
|
|
214
|
+
const diff = await summarizeGitDiffSince(baseline, options.dir, abortSignal);
|
|
215
|
+
if (diff.summary) text = `${text}\n\n${diff.summary}`;
|
|
216
|
+
changedFiles = diff.newFiles;
|
|
217
|
+
preexistingFiles = diff.preexistingFiles;
|
|
218
|
+
} catch (error) {
|
|
219
|
+
if (!abortSignal.aborted) throw error;
|
|
220
|
+
const reason = signal?.aborted ? "cancelled" : "reaching its deadline";
|
|
221
|
+
text += `\n\n(diff summary skipped: the run was ${reason} as agy finished)`;
|
|
222
|
+
}
|
|
208
223
|
}
|
|
209
224
|
if (abortSignal.aborted) {
|
|
210
|
-
|
|
225
|
+
text += `\n\nagy finished as the run was ${signal?.aborted ? "cancelled" : "timing out"}; the completed result is preserved.`;
|
|
211
226
|
}
|
|
212
|
-
remainingBudget(startedAt, options.timeout_ms);
|
|
213
227
|
|
|
214
228
|
return {
|
|
215
229
|
text,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juanbenjumea/pi-agy",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6",
|
|
4
4
|
"description": "Enhanced Antigravity CLI (agy) bridge for Pi — streaming progress, conversation continuity, repo-aware verify, and diff summaries.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|