@juanbenjumea/pi-agy 0.6.6 → 0.6.8
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 +13 -0
- package/README.md +12 -4
- package/extensions/lib/cli.ts +26 -2
- package/extensions/lib/doctor.ts +22 -1
- package/package.json +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.6.8
|
|
4
|
+
|
|
5
|
+
- Keep agy's internal `--print-timeout` five seconds behind Pi's hard parent deadline. agy 1.1.28+ returns partial output with exit code 0 when its own timeout fires, so Pi must win the race to classify the run as timed out and preserve resumable-conversation guidance.
|
|
6
|
+
- Recognize agy 1.2.6+ structured `AGY_ERROR` records with a top-level `retryable` boolean while retaining legacy status-text matching. Strict whole-line JSON parsing rejects malformed and user-controlled lookalikes, and canonical `retryable: false` overrides legacy patterns such as `429`.
|
|
7
|
+
- Add `npm run test:live`, an opt-in, zero-inference smoke for the installed CLI version, stable model aliases, custom-agent roster, quota schema, and doctor integration; refresh compile/test dependencies to Pi 0.86.1.
|
|
8
|
+
- Make CI and releases deterministic with `npm ci`, clean-tree and package checks, and isolate npm OIDC permissions in a publish-only job that runs only after unprivileged verification succeeds.
|
|
9
|
+
|
|
10
|
+
## 0.6.7
|
|
11
|
+
|
|
12
|
+
- Add custom-agent discovery health to `/agy doctor` using the same bounded, read-only `agy agents` path as `agy_agents` and `/agy agents`.
|
|
13
|
+
- Report configured agents as healthy (showing at most eight names), an empty roster as informational, and optional discovery failures as warnings without misclassifying the core CLI as unavailable.
|
|
14
|
+
- Skip the custom-agent probe alongside model/quota checks when the core CLI check fails; add configured, empty, failed, and skipped diagnostic coverage.
|
|
15
|
+
|
|
3
16
|
## 0.6.6
|
|
4
17
|
|
|
5
18
|
- Surface agy's native and legacy subagent spawn steps as bounded live progress and structured per-run observations (`details.subagents`) with ACTIVE/DONE/ERROR correlation, multi-spawn support, and retry-safe activity tracking.
|
package/README.md
CHANGED
|
@@ -42,7 +42,9 @@ Auth is unchanged: existing `agy` OAuth (`~/.gemini/oauth_creds.json`).
|
|
|
42
42
|
`timeout_ms` (default 5m, max 10m) is a hard parent-side deadline — lock
|
|
43
43
|
waits, preflight probes, and post-run summaries all count against it. When
|
|
44
44
|
it fires, the full agy process group is killed so nested tools cannot
|
|
45
|
-
outlive the run.
|
|
45
|
+
outlive the run. agy's own `--print-timeout` is set five seconds later because
|
|
46
|
+
agy 1.1.28+ returns partial output with exit code 0 when that internal timer
|
|
47
|
+
fires; Pi therefore remains the authoritative timeout owner.
|
|
46
48
|
|
|
47
49
|
Active tool updates show bounded intent (for example a tool action or async
|
|
48
50
|
threshold) but never echo full command lines, which may contain secrets.
|
|
@@ -134,7 +136,7 @@ Run agy directly from the Pi TUI — fast path when fully specified, wizard othe
|
|
|
134
136
|
/agy continue fix the tests # continue this directory's last conversation
|
|
135
137
|
/agy timeout=10m sonnet big task # raise the run cap (also 90s / 1500ms; bare = minutes)
|
|
136
138
|
/agy sessions # pick a recorded conversation to resume
|
|
137
|
-
/agy doctor # diagnose CLI, models, quota, config, sessions, lock, and repo gate
|
|
139
|
+
/agy doctor # diagnose CLI, models, agents, quota, config, sessions, lock, and repo gate
|
|
138
140
|
/agy usage # inspect model quotas and reset times
|
|
139
141
|
```
|
|
140
142
|
|
|
@@ -150,8 +152,9 @@ The interactive wizard and direct `agy_execute` calls default to
|
|
|
150
152
|
exploration/review. Sandbox runs do not bypass agy permission checks.
|
|
151
153
|
|
|
152
154
|
`/agy doctor` performs no inference and spends no model tokens. It reports the
|
|
153
|
-
installed CLI version, discoverable stable model aliases,
|
|
154
|
-
config, recorded sessions, workspace lock state,
|
|
155
|
+
installed CLI version, discoverable stable model aliases, optional custom-agent
|
|
156
|
+
discovery, quota support, active config, recorded sessions, workspace lock state,
|
|
157
|
+
and detected verification gate.
|
|
155
158
|
|
|
156
159
|
Missing pieces open interactive dialogs (mode select, model select with
|
|
157
160
|
descriptions, multi-line task editor). `accept-edits` asks for confirmation
|
|
@@ -206,6 +209,11 @@ npm test
|
|
|
206
209
|
npm run typecheck
|
|
207
210
|
```
|
|
208
211
|
|
|
212
|
+
With an installed, authenticated `agy`, run `npm run test:live` to verify the
|
|
213
|
+
CLI version, stable model catalog, custom-agent roster, quota schema, and doctor
|
|
214
|
+
integration against the real binary. The smoke uses read-only commands only and
|
|
215
|
+
does not start an inference turn or spend model tokens.
|
|
216
|
+
|
|
209
217
|
## License
|
|
210
218
|
|
|
211
219
|
MIT
|
package/extensions/lib/cli.ts
CHANGED
|
@@ -90,6 +90,10 @@ export interface AgyOptions {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
const PREFLIGHT_TIMEOUT_MS = 10_000;
|
|
93
|
+
// agy >= 1.1.28 returns partial output with exit 0 when its own print timeout
|
|
94
|
+
// fires. Keep that timeout behind Pi's hard parent deadline (and its 2s kill
|
|
95
|
+
// escalation) so a timed-out partial response can never be reported as success.
|
|
96
|
+
const PRINT_TIMEOUT_BUFFER_MS = 5_000;
|
|
93
97
|
// Raw stdout capture bound; only the non-streaming/parse-failure fallback —
|
|
94
98
|
// the stream-json path accumulates results incrementally and is not capped by
|
|
95
99
|
// it. Large enough that plain-text fallbacks rarely truncate.
|
|
@@ -236,9 +240,29 @@ export function supportsAgyEffort(model?: AgyModel, tier?: AgyOptions["tier"]):
|
|
|
236
240
|
const TRANSIENT_FAILURE_PATTERN =
|
|
237
241
|
/rate.?limit|resource[_ -]?exhausted|429|overloaded|temporarily unavailable|network|connection (reset|refused)|econnreset|etimedout|socket hang up|\b50[023]\b/i;
|
|
238
242
|
|
|
243
|
+
function parseStructuredRetryability(message: string): boolean | undefined {
|
|
244
|
+
for (const line of message.split(/\r?\n/)) {
|
|
245
|
+
const match = line.match(/^\s*AGY_ERROR:\s*(\{.*\})\s*$/);
|
|
246
|
+
if (!match) continue;
|
|
247
|
+
try {
|
|
248
|
+
const parsed: unknown = JSON.parse(match[1]);
|
|
249
|
+
if (
|
|
250
|
+
typeof parsed === "object" &&
|
|
251
|
+
parsed !== null &&
|
|
252
|
+
typeof (parsed as { retryable?: unknown }).retryable === "boolean"
|
|
253
|
+
) {
|
|
254
|
+
return (parsed as { retryable: boolean }).retryable;
|
|
255
|
+
}
|
|
256
|
+
} catch {
|
|
257
|
+
// Malformed structured diagnostics fall back to legacy text matching.
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return undefined;
|
|
261
|
+
}
|
|
262
|
+
|
|
239
263
|
/** Heuristic for transient agy failures that are safe to retry once. */
|
|
240
264
|
export function isTransientAgyFailure(message: string): boolean {
|
|
241
|
-
return TRANSIENT_FAILURE_PATTERN.test(message);
|
|
265
|
+
return parseStructuredRetryability(message) ?? TRANSIENT_FAILURE_PATTERN.test(message);
|
|
242
266
|
}
|
|
243
267
|
|
|
244
268
|
const MAX_AGENT_NAME_LENGTH = 128;
|
|
@@ -294,7 +318,7 @@ export function buildAgyArgs(options: AgyOptions): string[] {
|
|
|
294
318
|
|
|
295
319
|
const model = resolveAgyModelId(options.model, options.tier);
|
|
296
320
|
const agent = normalizeAgyAgentName(options.agent);
|
|
297
|
-
const timeoutSec = Math.ceil(options.timeout_ms / 1000);
|
|
321
|
+
const timeoutSec = Math.ceil((options.timeout_ms + PRINT_TIMEOUT_BUFFER_MS) / 1000);
|
|
298
322
|
const mode = options.mode ?? "accept-edits";
|
|
299
323
|
const writes = mode === "accept-edits";
|
|
300
324
|
const skipPermissions = options.skipPermissions ?? true;
|
package/extensions/lib/doctor.ts
CHANGED
|
@@ -3,6 +3,7 @@ import * as path from "node:path";
|
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
checkAgyUsage,
|
|
6
|
+
inspectAgyAgents,
|
|
6
7
|
inspectAgyModels,
|
|
7
8
|
inspectAgyVersion,
|
|
8
9
|
isAgyModel,
|
|
@@ -55,8 +56,9 @@ export async function runAgyDoctor(
|
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
if (cliAvailable) {
|
|
58
|
-
const [modelsResult, usageResult] = await Promise.allSettled([
|
|
59
|
+
const [modelsResult, agentsResult, usageResult] = await Promise.allSettled([
|
|
59
60
|
inspectAgyModels(resolvedCwd, signal, DOCTOR_TIMEOUT_MS),
|
|
61
|
+
inspectAgyAgents(resolvedCwd, signal, DOCTOR_TIMEOUT_MS),
|
|
60
62
|
checkAgyUsage(resolvedCwd, signal, DOCTOR_TIMEOUT_MS),
|
|
61
63
|
]);
|
|
62
64
|
|
|
@@ -74,6 +76,24 @@ export async function runAgyDoctor(
|
|
|
74
76
|
checks.push({ name: "Models", status: "error", detail: errorMessage(modelsResult.reason) });
|
|
75
77
|
}
|
|
76
78
|
|
|
79
|
+
if (agentsResult.status === "fulfilled") {
|
|
80
|
+
const agents = agentsResult.value;
|
|
81
|
+
const shown = agents.slice(0, 8);
|
|
82
|
+
checks.push({
|
|
83
|
+
name: "Custom agents",
|
|
84
|
+
status: agents.length ? "ok" : "info",
|
|
85
|
+
detail: agents.length
|
|
86
|
+
? `${agents.length} configured (${shown.join(", ")}${agents.length > shown.length ? `, +${agents.length - shown.length} more` : ""})`
|
|
87
|
+
: "none configured",
|
|
88
|
+
});
|
|
89
|
+
} else {
|
|
90
|
+
checks.push({
|
|
91
|
+
name: "Custom agents",
|
|
92
|
+
status: "warn",
|
|
93
|
+
detail: errorMessage(agentsResult.reason),
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
77
97
|
if (usageResult.status === "fulfilled") {
|
|
78
98
|
checks.push(quotaCheck(usageResult.value));
|
|
79
99
|
} else {
|
|
@@ -81,6 +101,7 @@ export async function runAgyDoctor(
|
|
|
81
101
|
}
|
|
82
102
|
} else {
|
|
83
103
|
checks.push({ name: "Models", status: "info", detail: "skipped because the CLI check failed" });
|
|
104
|
+
checks.push({ name: "Custom agents", status: "info", detail: "skipped because the CLI check failed" });
|
|
84
105
|
checks.push({ name: "Quota", status: "info", detail: "skipped because the CLI check failed" });
|
|
85
106
|
}
|
|
86
107
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juanbenjumea/pi-agy",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.8",
|
|
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",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"homepage": "https://github.com/huaxel/pi-agy#readme",
|
|
26
26
|
"scripts": {
|
|
27
27
|
"test": "node --import ./tests/resolve-hook.mjs --test tests/*.test.ts",
|
|
28
|
+
"test:live": "node --import ./tests/resolve-hook.mjs tests/live-smoke.ts",
|
|
28
29
|
"typecheck": "tsc --noEmit --pretty false",
|
|
29
30
|
"pack:check": "npm pack --dry-run --json"
|
|
30
31
|
},
|
|
@@ -49,9 +50,10 @@
|
|
|
49
50
|
"@sinclair/typebox": "*"
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
|
-
"@earendil-works/pi-
|
|
53
|
+
"@earendil-works/pi-coding-agent": "^0.86.1",
|
|
54
|
+
"@earendil-works/pi-tui": "^0.86.1",
|
|
53
55
|
"@sinclair/typebox": "^0.34.41",
|
|
54
|
-
"@types/node": "^22.
|
|
56
|
+
"@types/node": "^22.20.4",
|
|
55
57
|
"typescript": "^5.0.0"
|
|
56
58
|
},
|
|
57
59
|
"engines": {
|