@juanbenjumea/pi-agy 0.5.5 → 0.5.7

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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.7
4
+
5
+ - Documentation: add a "Timeouts & cancellation" section to the README covering deadline-preserving semantics (delivered results survive, post-run steps skip with notes, conversations stay resumable after timeout/cancel); note the Node >= 20.3 requirement; refresh the upstream-comparison table and skill bullets.
6
+ - Fix the 0.5.0 changelog's test-suite list (there is no `balance` suite; those cases live in `config`).
7
+
8
+ ## 0.5.6
9
+
10
+ - 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).
11
+
3
12
  ## 0.5.5
4
13
 
5
14
  - 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.
@@ -67,7 +76,7 @@
67
76
  - Ignore preview/experimental model ids in live catalog resolution unless `PI_AGY_ALLOW_PREVIEW=1`.
68
77
  - Ship a publishable `LICENSE`, add `typecheck`/`pack:check` scripts, and verify the packed tarball contents.
69
78
  - Add `tests/regression.test.ts`: fake-agy cancel/timeout/malformed-JSONL integration, a grandchild file-write proof that tree-kill stops nested writers, preview filtering, stream bounds, baseline diff attribution, symlink lock sharing, and artifact checks.
70
- - Split the monolithic `tests/cli.test.ts` into focused suites (`cli-args`, `verify`, `stream`, `postflight`, `execution`, `command`, `config`, `sessions`, `balance`, `lock`) sharing a `tests/helpers.ts` fake-agy harness.
79
+ - Split the monolithic `tests/cli.test.ts` into focused suites (`cli-args`, `verify`, `stream`, `postflight`, `execution`, `command`, `config` — including quota-balancing cases, `sessions`, `lock`) plus `tests/regression.test.ts`, sharing a `tests/helpers.ts` fake-agy harness.
71
80
  - Document `PI_AGY_ALLOW_PREVIEW=1` as the explicit opt-in for preview/experimental model ids.
72
81
  - Normalize equivalent working-directory paths before locking so concurrent calls cannot bypass serialization.
73
82
 
package/README.md CHANGED
@@ -10,23 +10,42 @@ Delegates bulk work to the Antigravity CLI (`agy`) while Pi stays the conductor.
10
10
  pi install npm:@juanbenjumea/pi-agy
11
11
  ```
12
12
 
13
+ Requires Node.js >= 20.3.
14
+
13
15
  ## What's different from upstream 0.3.1
14
16
 
15
17
  | Feature | Upstream | This fork |
16
18
  |---------|----------|-----------|
17
19
  | Live progress | Final text only | `stream-json` → Pi `onUpdate` cards |
18
20
  | Model aliases | Hardcoded ids | Live `agy models` catalog (newest stable generation wins; preview/experimental ignored), static map fallback |
19
- | Conversation resume | None | `conversation_id`, `continue`, session store, `/agy sessions` picker |
21
+ | Conversation resume | None | `conversation_id`, `continue`, session store, `/agy sessions` picker — runs that time out or are cancelled are recorded too |
20
22
  | Verify injection | `npm test` only | `just ci` first, then `npm test`/`uv run pytest` |
21
- | Post-write summary | None | Appends `git diff --stat` for newly-dirty files only; pre-existing dirt is listed separately |
23
+ | Post-write summary | None | Appends `git diff --stat` for newly-dirty files only; pre-existing dirt (including renames and unstaged edits) is listed separately and never misattributed |
22
24
  | Preflight | Every call | Health/model checks cached 5 min per process; model quotas refresh every minute |
23
25
  | Quota discovery | None | Read-only `/usage` probe exposes model-specific remaining quota and reset times to agents |
24
26
  | Concurrency | Unlocked | Per-directory lock (in-process + filesystem, symlink-aware), lock wait counts against the timeout |
25
27
  | Transient failures | Fatal | One retry when agy fails before doing any work |
26
- | Cancellation | Direct child only | Full process-tree kill on cancel/timeout via detached process groups |
28
+ | Cancellation | Direct child only | Full process-tree kill on cancel/timeout via detached process groups; a fully delivered result is preserved |
27
29
 
28
30
  Auth is unchanged: existing `agy` OAuth (`~/.gemini/oauth_creds.json`).
29
31
 
32
+ ## Timeouts & cancellation
33
+
34
+ `timeout_ms` (default 5m, max 10m) is a hard parent-side deadline — lock
35
+ waits, preflight probes, and post-run summaries all count against it. When
36
+ it fires, the full agy process group is killed so nested tools cannot
37
+ outlive the run.
38
+
39
+ The deadline never discards finished work:
40
+
41
+ - A response that fully arrived before the kill is returned with an
42
+ explanatory note instead of being thrown away — even if cancellation or
43
+ the deadline landed between delivery and process exit.
44
+ - Post-run steps cut short by the deadline (the accept-edits diff summary)
45
+ are skipped with a note rather than failing the run.
46
+ - The conversation id is recorded on timeout and cancellation, so the run
47
+ stays resumable via `conversation_id`, `/agy continue`, or `/agy sessions`.
48
+
30
49
  ## Tool params (new)
31
50
 
32
51
  | Param | Description |
@@ -217,7 +217,8 @@ export async function executeAgyTask(
217
217
  preexistingFiles = diff.preexistingFiles;
218
218
  } catch (error) {
219
219
  if (!abortSignal.aborted) throw error;
220
- text += "\n\n(diff summary skipped: the run reached its deadline as agy finished)";
220
+ const reason = signal?.aborted ? "cancelled" : "reaching its deadline";
221
+ text += `\n\n(diff summary skipped: the run was ${reason} as agy finished)`;
221
222
  }
222
223
  }
223
224
  if (abortSignal.aborted) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juanbenjumea/pi-agy",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
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",
@@ -72,8 +72,8 @@ agy_usage
72
72
 
73
73
  - **Quota discovery** — `agy_usage` and `/agy usage` report model-specific remaining quota and reset times; executions refresh quota snapshots and return machine-readable `quota_status` as well.
74
74
  - **Streaming progress** — live tool steps via `stream-json` and Pi `onUpdate`.
75
- - **Conversation continuity** — `conversation_id`, `continue`, session store under `$PI_CODING_AGENT_DIR/agy-sessions.json` (or `~/.pi/agent/agy-sessions.json` by default).
75
+ - **Conversation continuity** — `conversation_id`, `continue`, session store under `$PI_CODING_AGENT_DIR/agy-sessions.json` (or `~/.pi/agent/agy-sessions.json` by default); runs that time out or are cancelled are recorded too and stay resumable.
76
76
  - **Repo-aware verify** — prefers `just ci` when a justfile defines `ci:`.
77
77
  - **Diff summary** — accept-edits results append newly-dirty files only; pre-existing dirt is listed separately, never misattributed.
78
78
  - **Per-directory lock** — serializes concurrent agy calls on the same tree across Pi processes (symlink-aware).
79
- - **Cancellation** — abort/timeout kills the full agy process tree, and streamed records plus responses are size-bounded.
79
+ - **Cancellation** — abort/timeout kills the full agy process tree, and streamed records plus responses are size-bounded; a fully delivered result survives cancellation or timeout, and the conversation stays resumable.