@juanbenjumea/pi-agy 0.7.1 → 0.7.3
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 +11 -0
- package/extensions/lib/preflight.ts +26 -4
- package/extensions/lib/spawn.ts +10 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.7.3
|
|
4
|
+
|
|
5
|
+
- Retry health probes once on timeout so cold-start OAuth stampedes no longer fail delegation runs; auth failures, missing binaries, and cancellations still fail fast. Live smoke probe cap raised for the same cold-start reason.
|
|
6
|
+
- Full 282-test gate plus typecheck and package checks pass.
|
|
7
|
+
|
|
8
|
+
## 0.7.2
|
|
9
|
+
|
|
10
|
+
- Resolve stderr text when a successful run leaves stdout empty or whitespace-only (ported from upstream 0.3.8/0.3.9), after the terminal-status and permission-denial fail-closed checks so those semantics stand; stdout responses still win over stderr diagnostics.
|
|
11
|
+
- Cover symlink canonicalization into one directory-lock chain (our answer to upstream 0.3.6's symlink-escape rejection: resolve, don't reject).
|
|
12
|
+
- Full 280-test gate plus typecheck and package checks pass.
|
|
13
|
+
|
|
3
14
|
## 0.7.1
|
|
4
15
|
|
|
5
16
|
- Report provider runtime state in `/agy doctor` (driver turns/reuses/recycles, bridge tool count, suspended turns awaiting Pi tools, live image staging) via a never-throwing status snapshot.
|
|
@@ -29,10 +29,7 @@ export async function runPreflight(
|
|
|
29
29
|
|
|
30
30
|
const health = healthFresh
|
|
31
31
|
? Promise.resolve()
|
|
32
|
-
:
|
|
33
|
-
checkAgyHealth(cwd, signal, timeoutMs),
|
|
34
|
-
checkAgyConnectivity(cwd, signal, timeoutMs),
|
|
35
|
-
]).then(() => undefined);
|
|
32
|
+
: runHealthWithRetry(cwd, signal, timeoutMs).then(() => undefined);
|
|
36
33
|
const usage = usageFresh ? Promise.resolve(cachedUsage) : checkAgyUsage(cwd, signal, timeoutMs);
|
|
37
34
|
const [, refreshedUsage] = await Promise.all([health, usage]);
|
|
38
35
|
if (!healthFresh) cachedAt = Date.now();
|
|
@@ -43,6 +40,31 @@ export async function runPreflight(
|
|
|
43
40
|
return cachedUsage;
|
|
44
41
|
}
|
|
45
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Health probes with one retry on timeout. Four parallel cold agy spawns
|
|
45
|
+
* can serialize behind a single OAuth refresh past the per-probe cap; the
|
|
46
|
+
* retry almost always lands warm. Only timeouts retry: auth failures,
|
|
47
|
+
* missing binaries, and cancellations fail fast on first attempt.
|
|
48
|
+
*/
|
|
49
|
+
async function runHealthWithRetry(
|
|
50
|
+
cwd: string,
|
|
51
|
+
signal: AbortSignal | undefined,
|
|
52
|
+
timeoutMs: number | undefined,
|
|
53
|
+
): Promise<void> {
|
|
54
|
+
const attempt = (): Promise<void> =>
|
|
55
|
+
Promise.all([
|
|
56
|
+
checkAgyHealth(cwd, signal, timeoutMs),
|
|
57
|
+
checkAgyConnectivity(cwd, signal, timeoutMs),
|
|
58
|
+
]).then(() => undefined);
|
|
59
|
+
try {
|
|
60
|
+
await attempt();
|
|
61
|
+
} catch (error) {
|
|
62
|
+
if (signal?.aborted) throw error;
|
|
63
|
+
if (!(error instanceof Error) || !/timed out/i.test(error.message)) throw error;
|
|
64
|
+
await attempt();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
46
68
|
/** Test helper — reset the in-process cache. */
|
|
47
69
|
export function resetPreflightCache(): void {
|
|
48
70
|
cachedAt = 0;
|
package/extensions/lib/spawn.ts
CHANGED
|
@@ -364,6 +364,16 @@ function spawnAgyInternal(
|
|
|
364
364
|
if (stdoutTruncated && !finalized.response_complete) {
|
|
365
365
|
finalized.response += `\n\n(raw stdout capture was truncated at the ${MAX_CAPTURE_BYTES / 1024} KB fallback bound)`;
|
|
366
366
|
}
|
|
367
|
+
// Upstream 0.3.8/0.3.9: success resolves stdout-only, except a
|
|
368
|
+
// stray newline on stdout with the real message on stderr resolves
|
|
369
|
+
// with the stderr text instead of near-empty output. Runs after
|
|
370
|
+
// the denied/terminal checks so those fail-closed semantics stand.
|
|
371
|
+
// Stderr stays bounded by the capture above.
|
|
372
|
+
const responseText = finalized.response.trim();
|
|
373
|
+
if ((responseText === "" || responseText === "(empty response)") && err.trim()) {
|
|
374
|
+
finalized.response = err.trim();
|
|
375
|
+
finalized.response_complete = true;
|
|
376
|
+
}
|
|
367
377
|
resolve(finalized);
|
|
368
378
|
});
|
|
369
379
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juanbenjumea/pi-agy",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"description": "Reliable Antigravity delegation for Pi — quota-aware runs, resumable tasks, repo verification, cancellation, and trustworthy diff summaries.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|