open-pstack 0.9.162 → 0.9.171

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/NOTICE.md CHANGED
@@ -38,7 +38,7 @@ Summary of structural changes:
38
38
  - Six skills imported from `cursor-team-kit`: `deslop`, `make-pr-easy-to-review`, `fix-ci`, `fix-merge-conflicts`, `get-pr-comments`, `what-did-i-get-done`. Five are copied verbatim with no rewiring needed. `deslop` is a policy fork that `tools/forks.json` declares.
39
39
  - Three skills and two agents imported from `thermos`: `thermos`, `thermo-nuclear-review`, `thermo-nuclear-code-quality-review`, `thermo-nuclear-review-subagent`, and `thermo-nuclear-code-quality-review-subagent`. The skills' `subagent_type` values take the `pstack:` namespace, and the agents' parent-orchestration notes name Claude Code's tools; `tools/substitutions.json` lists each rewrite.
40
40
  - `plugins/pstack/skills/babysit/` is independently authored as the Claude Code analog of Cursor's `/babysit` built-in. It has no upstream pstack equivalent; its workflow is informed by Cursor's public `/babysit` behavior. No code or prose was copied from any source.
41
- - `plugins/pstack/skills/poteto-mode/scripts/` is vendored from upstream (`watch-pr`, `bootstrap.ts`, `package.json`, `bun.lock`). `worktree-audit.mjs` is a port-only rewrite of upstream's `worktree-audit.sh`, which `tools/upstream.json` excludes from sync; it reads the Claude Code, Codex, and Pi transcript directories instead of Cursor's and reports prunable worktrees. Port edits, each on the forked list `bun tools/sync.mjs --dry-run` prints: `bootstrap.ts` fails clearly under node and installs production dependencies only; `package.json` typechecks the whole tree; `tsconfig.json` is port-only. Everything else is upstream's code under the upstream MIT license.
41
+ - `plugins/pstack/skills/poteto-mode/scripts/` is vendored from upstream (`watch-pr`, `bootstrap.ts`, `package.json`, `bun.lock`). `worktree-audit.mjs` is a port-only rewrite of upstream's `worktree-audit.sh`, which `tools/upstream.json` excludes from sync; it reads the Claude Code, Codex, and Pi transcript directories instead of Cursor's and reports prunable worktrees. Port edits, each on the forked list `bun tools/sync.mjs --dry-run` prints: `bootstrap.ts` fails clearly under node and installs locked production dependencies only, into the user cache instead of the plugin; `package.json` typechecks the whole tree; `tsconfig.json` is port-only. Everything else is upstream's code under the upstream MIT license.
42
42
  - `plugins/pstack/agents/comment-sicko.md` is upstream's `Comment Sicko` agent, renamed to `comment-sicko` so the name works as a Claude Code `subagent_type`. The body is verbatim.
43
43
  - A Codex build shares the same `skills/` tree. It adds `plugins/pstack/.codex-plugin/plugin.json`, a root `.agents/plugins/marketplace.json`, and `plugins/pstack/skills/poteto-mode/references/codex-tools.md` (the Claude-to-Codex tool, model, built-in, and per-skill map). Affected skill entry points link to this map. See the [reference](docs/reference.md#codex).
44
44
 
package/lib/steps.mjs CHANGED
@@ -3,7 +3,10 @@ import {
3
3
  cpSync,
4
4
  lstatSync,
5
5
  mkdirSync,
6
+ mkdtempSync,
6
7
  readdirSync,
8
+ renameSync,
9
+ rmSync,
7
10
  symlinkSync,
8
11
  } from "node:fs";
9
12
  import { dirname, join } from "node:path";
@@ -65,12 +68,26 @@ const EXECUTORS = {
65
68
  run: (step, ctx) => spawnArgv(step.argv, ctx),
66
69
  manual: () => ({ ok: true, manual: true }),
67
70
  copy: (step) => {
68
- if (exists(step.to)) {
69
- return { ok: true, skipped: true, detail: `${step.to} already present, see README update steps` };
71
+ const present = { ok: true, skipped: true, detail: `${step.to} already present, see README update steps` };
72
+ if (exists(step.to)) return present;
73
+ const parent = dirname(step.to);
74
+ mkdirSync(parent, { recursive: true });
75
+ const temp = mkdtempSync(join(parent, ".pstack-copy-"));
76
+ try {
77
+ const plugin = join(temp, "plugin");
78
+ cpSync(step.from, plugin, { recursive: true, filter: withoutNodeModules(step.from) });
79
+ if (exists(step.to)) return present;
80
+ try {
81
+ renameSync(plugin, step.to);
82
+ } catch (error) {
83
+ // Another installer may have published its complete copy first.
84
+ if (["EEXIST", "ENOTEMPTY", "EPERM", "ENOTDIR"].includes(error.code) && exists(step.to)) return present;
85
+ throw error;
86
+ }
87
+ return { ok: true };
88
+ } finally {
89
+ rmSync(temp, { recursive: true, force: true });
70
90
  }
71
- mkdirSync(dirname(step.to), { recursive: true });
72
- cpSync(step.from, step.to, { recursive: true, filter: withoutNodeModules(step.from) });
73
- return { ok: true };
74
91
  },
75
92
  stage: (step) => {
76
93
  stagePlugin(step.from, step.to, { exclude: step.exclude });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-pstack",
3
- "version": "0.9.162",
3
+ "version": "0.9.171",
4
4
  "description": "Install pstack into the agent harnesses on this machine: Claude Code, Codex, Pi, Copilot, Muse, OMP, Kimi, Grok, MiniMax, OpenCode, Antigravity, and the shared skills directory.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pstack",
3
- "version": "0.9.162",
3
+ "version": "0.9.171",
4
4
  "description": "If you want to go fast, go deep first. pstack helps you write less, but higher quality code. rigorous agent workflows you can parallelize with confidence. Ported from cursor/plugins/pstack to Antigravity. Original pstack by Lauren Tan (poteto).",
5
5
  "author": "Michael Denyer",
6
6
  "logo": "assets/pstack-icon.png",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pstack",
3
3
  "displayName": "pstack (Claude Code port)",
4
- "version": "0.9.162",
4
+ "version": "0.9.171",
5
5
  "description": "If you want to go fast, go deep first. pstack helps you write less, but higher quality code. rigorous agent workflows you can parallelize with confidence. Ported from cursor/plugins/pstack to Claude Code. Original pstack by Lauren Tan (poteto).",
6
6
  "author": {
7
7
  "name": "Michael Denyer",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pstack",
3
- "version": "0.9.162",
3
+ "version": "0.9.171",
4
4
  "description": "If you want to go fast, go deep first. pstack helps you write less, but higher quality code. rigorous agent workflows you can parallelize with confidence. Codex port of the Claude Code plugin; skills are shared, tool names resolve via skills/poteto-mode/references/codex-tools.md. Original pstack by Lauren Tan (poteto).",
5
5
  "author": {
6
6
  "name": "Michael Denyer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pstack",
3
3
  "displayName": "pstack (GitHub Copilot port)",
4
- "version": "0.9.162",
4
+ "version": "0.9.171",
5
5
  "description": "If you want to go fast, go deep first. pstack helps you write less, but higher quality code. rigorous agent workflows you can parallelize with confidence. Ported from cursor/plugins/pstack to GitHub Copilot CLI and app. Original pstack by Lauren Tan (poteto).",
6
6
  "author": {
7
7
  "name": "Michael Denyer",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pstack",
3
- "version": "0.9.162",
3
+ "version": "0.9.171",
4
4
  "description": "pstack workflows and skills for Grok Build",
5
5
  "skills": [
6
6
  "./skills",
@@ -2,7 +2,7 @@
2
2
  "schemaVersion": 1,
3
3
  "name": "pstack",
4
4
  "displayName": "pstack (Muse port)",
5
- "version": "0.9.162",
5
+ "version": "0.9.171",
6
6
  "description": "If you want to go fast, go deep first. pstack helps you write less, but higher quality code. Rigorous agent workflows you can parallelize with confidence. Muse port of the Claude Code plugin; skills are shared, tool names resolve via skills/poteto-mode/references/muse-tools.md. Original pstack by Lauren Tan (poteto).",
7
7
  "compat": {
8
8
  "source": "native",
@@ -1,9 +1,55 @@
1
1
  # Prints the Antigravity SessionStart output: one JSON object whose injectSteps
2
- # systemMessage is the poteto-mode mandate for Antigravity. Run after json.awk.
3
- { lines[++n] = $0 }
2
+ # systemMessage is the poteto-mode mandate for Antigravity, followed by any
3
+ # checked role lines from the Antigravity model sheet. Run after json.awk and
4
+ # setup-pstack's sheet.awk, with the sheet as input, -v found=<1 when the sheet
5
+ # exists>, and PSTACK_HOOKS=<this directory> in the environment.
6
+ # Only known role lines whose entries are Antigravity invoke_subagent Model
7
+ # values (inherit, flash_lite, flash, pro) or pstack aliases (inherit-parent,
8
+ # auto) reach the output, rebuilt from their checked values, so no other text
9
+ # in the sheet does.
10
+ { sheet_add($0) }
4
11
 
5
12
  END {
13
+ body = text("session-start-agy.md")
14
+ if (found) {
15
+ n = sheet_roles(roles, panel)
16
+ for (i = 1; i <= SHEET_N; i++) raw[sheet_key(SHEET[i])] = sheet_value(SHEET[i])
17
+ role_lines = ""
18
+ for (i = 1; i <= n; i++) {
19
+ label = roles[i]
20
+ if (!(label in raw)) continue
21
+ m = split(raw[label], E, ",")
22
+ if (m == 0) continue
23
+ ok = 1
24
+ rebuilt = ""
25
+ for (j = 1; j <= m; j++) {
26
+ e = sheet_trim(E[j])
27
+ if (!agy_model(e)) { ok = 0; break }
28
+ rebuilt = rebuilt (j > 1 ? ", " : "") e
29
+ }
30
+ if (ok) role_lines = role_lines (role_lines == "" ? "" : "\n") label ": " rebuilt
31
+ }
32
+ if (role_lines != "") body = body "\n\n" text("session-start-agy-sheet.md") "\n" role_lines
33
+ }
34
+ n = split(body, L, "\n")
6
35
  out = ""
7
- for (i = 1; i <= n; i++) out = out (i > 1 ? "\\n" : "") esc(lines[i])
36
+ for (i = 1; i <= n; i++) out = out (i > 1 ? "\\n" : "") esc(L[i])
8
37
  print "{\"injectSteps\":[{\"systemMessage\":{\"systemMessage\":\"" out "\"}}]}"
9
38
  }
39
+
40
+ function agy_model(id) {
41
+ return id == "inherit" || sheet_alias(id) || id == "flash_lite" || id == "flash" || id == "pro"
42
+ }
43
+
44
+ # The file's text without its trailing newline.
45
+ function text(name, file, line, s, first) {
46
+ file = ENVIRON["PSTACK_HOOKS"] "/" name
47
+ s = ""
48
+ first = 1
49
+ while ((getline line < file) > 0) {
50
+ s = s (first ? "" : "\n") line
51
+ first = 0
52
+ }
53
+ close(file)
54
+ return s
55
+ }
@@ -0,0 +1 @@
1
+ These are the user's saved pstack model choices from the Antigravity model sheet. Each role line is an explicit model instruction for `invoke_subagent`'s `Model` parameter; `inherit`, `inherit-parent`, or `auto` omits `Model` so the subagent uses the parent session's active model. Use these instead of reading the sheet:
@@ -72,8 +72,15 @@ if [ "${PSTACK_SESSION_HOOK:-}" = off ] || printf '%s\n' "$normalized" | grep -q
72
72
  exit 0
73
73
  fi
74
74
 
75
+ # Antigravity parses stdout as one JSON object with injectSteps. Its sheet sits
76
+ # behind Antigravity's system protection boundary, so the hook checks the sheet
77
+ # and adds its known role lines to the mandate, and the agent never reads the
78
+ # file.
75
79
  if [ "$runtime" = agy ]; then
76
- LC_ALL=C awk -f ./hooks/json.awk -f ./hooks/agy-context.awk ./hooks/session-start-agy.md
80
+ printf '%s\n' "$normalized" | PSTACK_HOOKS=./hooks LC_ALL=C awk -v found="$found" \
81
+ -f ./hooks/json.awk \
82
+ -f ./skills/setup-pstack/scripts/sheet.awk \
83
+ -f ./hooks/agy-context.awk
77
84
  exit 0
78
85
  fi
79
86
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pstack",
3
- "version": "0.9.162",
3
+ "version": "0.9.171",
4
4
  "private": true,
5
5
  "omp": {
6
6
  "extensions": ["./omp/index.mjs"]
@@ -30,6 +30,8 @@ function header({ agent, ...record }: EndedRecord, transcript: string | undefine
30
30
  // Not "orca worktree ...": on Linux a bare orca is the screen reader.
31
31
  const removal = agent.host === "t3" ? "T3 Code's cleanup settings decide when it is removed" : "Orca keeps it until you remove the workspace, e.g. with the Orca CLI's worktree rm";
32
32
  lines.push(`worktree: ${agent.hostWorktree.path} (${branch}${removal})`);
33
+ } else if (agent.hostWorktree && agent.t3ThreadId) {
34
+ lines.push(`worktree: not reported (isolation "worktree" was asked for, but T3 Code did not report a checkout for the agent's thread, so the agent may have run in the session thread's folder)`);
33
35
  }
34
36
  if (transcript) lines.push(`transcript: ${transcript}`);
35
37
  return lines.join("\n");
@@ -311,20 +311,23 @@ export class AgentRunner {
311
311
  private launch(identity: AgentIdentity, prompt: string, background: boolean): RunningRecord {
312
312
  if (this.closed) throw new Error("This session is shutting down; no agent can start.");
313
313
  if ((identity.host === "hc" || identity.host === "orca") && !prompt.trim()) throw new Error("The prompt is empty once trimmed, so the agent would have no task; send the task as text.");
314
+ let created: Worktree | undefined;
315
+ let spawned: ReturnType<AgentRunner["spawnChild"]>;
314
316
  try {
315
- // First, so a failure here leaves no worktree or branch behind.
316
317
  this.ensureSystemPrompt(identity);
317
- if (identity.worktree) ensureWorktree(identity.worktree);
318
+ if (identity.worktree && ensureWorktree(identity.worktree)) created = identity.worktree;
319
+ spawned = this.spawnChild(identity, prompt);
318
320
  } catch (e) {
321
+ const cleanup = created && settle(created);
319
322
  // A resume that cannot launch leaves the agent's record as its last run ended.
320
323
  if (!this.agents.has(identity.id)) {
321
- const failed: EndedRecord = { agent: identity, status: "failed", exitCode: null, endedAt: now(), finalText: (e as Error).message };
324
+ const failed: EndedRecord = { agent: identity, status: "failed", exitCode: null, endedAt: now(), worktreeKept: cleanup?.kept, finalText: (e as Error).message + (cleanup?.note ?? "") };
322
325
  this.agents.set(identity.id, { kind: "ended", record: failed });
323
326
  this.persist(failed);
324
327
  }
325
328
  throw e;
326
329
  }
327
- const { child, host, t3RequestId } = this.spawnChild(identity, prompt);
330
+ const { child, host, t3RequestId } = spawned;
328
331
  const pidStart = child.pid === undefined ? undefined : inspect(child.pid)?.start;
329
332
  // An RPC record leaves host unset, as earlier versions wrote it, so an older pstack can still restore it.
330
333
  const record: RunningRecord = { agent: identity, status: "running", pid: child.pid, pidStart, parentPid: process.pid, parentStart: inspect(process.pid)?.start, host: host === "rpc" ? undefined : host, t3RequestId };
@@ -112,21 +112,19 @@ export function parseSheet(text: string): Sheet {
112
112
  // A sheet committed with the project replaces the user's in that project, as the
113
113
  // Claude session hook does: the git root of the working directory, or the
114
114
  // directory itself when git cannot say (not a repository, or no git).
115
- // A directory's git root does not change within a process, so it is asked once;
116
- // the sheet itself is read again on every call.
115
+ // Cache successful lookups. A later git init or a recovered git process can
116
+ // give the same directory a root. The sheet itself is read on every call.
117
117
  const gitRoots = new Map<string, string>();
118
118
  export function projectRoot(cwd: string): string {
119
119
  const cached = gitRoots.get(cwd);
120
120
  if (cached !== undefined) return cached;
121
- let root = cwd;
122
121
  try {
123
- root = execFileSync("git", ["rev-parse", "--show-toplevel"], { cwd, encoding: "utf8", stdio: ["ignore", "pipe", "ignore"], timeout: 10_000 }).trim();
124
- } catch (e) {
125
- if ((e as NodeJS.ErrnoException).code === "ETIMEDOUT") return cwd;
126
- // The directory itself is the root, as in the session hook.
122
+ const root = execFileSync("git", ["rev-parse", "--show-toplevel"], { cwd, encoding: "utf8", stdio: ["ignore", "pipe", "ignore"], timeout: 10_000 }).trim();
123
+ gitRoots.set(cwd, root);
124
+ return root;
125
+ } catch {
126
+ return cwd;
127
127
  }
128
- gitRoots.set(cwd, root);
129
- return root;
130
128
  }
131
129
 
132
130
  function projectSheetFile(cwd: string): string | undefined {
@@ -158,7 +158,10 @@ export class OrcaChild {
158
158
  if (this.ending) throw new Error("stopped before its tab opened");
159
159
  const head = stdout.trim();
160
160
  const args = ["worktree", "create", `--name=${name}`, `--parent-worktree=${selector(session.worktree)}`, `--base-branch=${head}`];
161
- const { id, path, branch } = (await this.orca(worktreeResult, args, { cwd, timeout: CREATE_TIMEOUT_MS })).result.worktree;
161
+ // A create whose reply was lost may still have made the workspace.
162
+ const made = await this.orca(worktreeResult, ["worktree", "show", `--worktree=name:${name}`], { cwd }).catch(() => undefined);
163
+ if (!made && this.ending) throw new Error("stopped before its tab opened");
164
+ const { id, path, branch } = (made ?? (await this.orca(worktreeResult, args, { cwd, timeout: CREATE_TIMEOUT_MS }))).result.worktree;
162
165
  onWorktree({ id, path, branch: branch.replace(/^refs\/heads\//, "") });
163
166
  if (this.ending) throw new Error("stopped before its tab opened");
164
167
  return { worktree: { id }, cwd: path };
@@ -7,6 +7,7 @@ import { alive, type ChildExit, type Fate, type HostCheckout } from "./child.ts"
7
7
 
8
8
  const PROTOCOL = "2025-06-18";
9
9
  const WAIT_MS = 30_000;
10
+ const STOPPED_READ_MS = 1_000;
10
11
  const LOST_LAUNCH = "pstack: the Pi session that started this agent ended before T3 Code answered its launch, so the task is cancelled.";
11
12
  const LATE_STEER = "T3 Code put it in the agent's thread after pstack stopped following the agent's run, so pstack does not read the reply.";
12
13
  // T3 Code's terminal task statuses (OrchestratorMcpTerminalDelegatedTaskStatus).
@@ -142,15 +143,15 @@ export class T3Child {
142
143
  private async drive(launch: T3Launch, prompt: string): Promise<ChildExit> {
143
144
  const exit = await this.run(launch, prompt);
144
145
  if (!launch.onWorktree || this.threadId === undefined) return exit;
145
- const checkout = await this.checkout(this.threadId, launch.graceMs);
146
+ const checkout = await this.checkout(this.threadId, this.ending ? STOPPED_READ_MS : launch.graceMs);
146
147
  if (checkout) launch.onWorktree(checkout);
147
148
  return exit;
148
149
  }
149
150
 
150
151
  // T3 Code may rename the branch after the first turn, so the thread is read after each run.
151
- private async checkout(threadId: string, graceMs: number): Promise<HostCheckout | undefined> {
152
+ private async checkout(threadId: string, timeoutMs: number): Promise<HostCheckout | undefined> {
152
153
  try {
153
- const { thread } = await this.mcp.call(threadRead, "t3_thread_read", { threadId, limit: 1, maxCharsPerItem: 1 }, AbortSignal.timeout(graceMs));
154
+ const { thread } = await this.mcp.call(threadRead, "t3_thread_read", { threadId, limit: 1, maxCharsPerItem: 1 }, AbortSignal.timeout(timeoutMs));
154
155
  return thread.worktreePath === null ? undefined : { path: thread.worktreePath, ...(thread.branch !== null && { branch: thread.branch }) };
155
156
  } catch {
156
157
  return undefined;
@@ -57,14 +57,16 @@ function assertWorktree(wt: Worktree, created = false): void {
57
57
  }
58
58
 
59
59
  // Creates the worktree on first use and re-creates it for a resume after a
60
- // clean finish removed it. A retained path is checked before any child starts.
61
- export function ensureWorktree(wt: Worktree): void {
60
+ // clean finish removed it. Returns true for a newly created checkout. A retained
61
+ // path is checked before any child starts.
62
+ export function ensureWorktree(wt: Worktree): boolean {
62
63
  const created = !existsSync(wt.path);
63
64
  if (created) {
64
65
  const branchExists = git(wt.repo, ["branch", "--list", wt.branch]) !== "";
65
66
  git(wt.repo, branchExists ? ["worktree", "add", wt.path, wt.branch] : ["worktree", "add", wt.path, "-b", wt.branch, wt.base]);
66
67
  }
67
68
  assertWorktree(wt, created);
69
+ return created;
68
70
  }
69
71
 
70
72
  // True when the agent left anything behind and the worktree stays. Ignored
@@ -39,19 +39,19 @@ poteto-mode's Subagents section sets Claude-specific defaults (`subagent_type: "
39
39
 
40
40
  ## Model names
41
41
 
42
- Skills name Claude Code model aliases in their Models sections. On Antigravity (`agy`), `invoke_subagent`'s `Model` parameter accepts `inherit` (default, uses the parent's model), `flash_lite`, `flash`, and `pro`.
42
+ Skills name Claude Code model aliases in their Models sections. Those aliases do not resolve on Antigravity (`agy`). Antigravity's `invoke_subagent` `Model` parameter accepts only the tier values `inherit` (the default, which uses the parent session's active model), `flash_lite`, `flash`, and `pro`. It does not accept specific models such as Gemini 4 Argon, Carbon, or Neon, nor other model families. Passing `pro`, `flash`, or `flash_lite` routes subagents to fixed tier models instead of the parent session's active model.
43
43
 
44
- - The model sheet is `~/.gemini/config/pstack-models.md`. Before a skill that needs a role model (`arena`, `interrogate`, `no-comments`, `poteto-mode`, `swarm`, `thermos`), read it. With no sheet, read `setup-pstack`'s `SKILL.md` and finish it first.
45
- - Pass the role's model as `Model` on `invoke_subagent`. For `inherit-parent` or `auto`, omit `Model`.
46
- - Roles that default to the worker model (`feature, refactoring`): the worker model the user chose.
47
- - Roles that default to the strongest model (`strongest judgment`): the strongest model the user chose.
48
- - Diverse-model panels (`arena`, `interrogate`): the adversarial signal comes from model diversity. Use distinct available models and report when the panel shares a model family.
44
+ - The model sheet is `~/.gemini/config/pstack-models.md`. It sits behind Antigravity's system protection boundary, so outside `/setup-pstack`, do not read or write it directly from agent tools. The plugin's `SessionStart` hook reads it and appends any valid role lines to the session context as the user's saved pstack model choices. Take role overrides from that block (or from `AGENTS.md` / `GEMINI.md` when pasted there).
45
+ - When no saved role override is present for a role-model skill (`arena`, `interrogate`, `no-comments`, `poteto-mode`, `swarm`, `thermos`), omit `Model` (equivalent to `inherit`) so subagents run on the parent session's active model. Do not run `setup-pstack` just because no sheet is injected, and do not pass `pro`, `flash`, or `flash_lite` unless a saved role line or the user explicitly asks for that tier.
46
+ - Pass a saved role's tier as `Model` on `invoke_subagent`. For `inherit`, `inherit-parent`, or `auto`, omit `Model`.
47
+ - Roles that default to the worker model (`feature, refactoring`) or strongest model (`strongest judgment`): omit `Model` (`inherit`) unless the user configured an explicit tier override.
48
+ - Diverse-model panels (`arena`, `interrogate`): the adversarial signal comes from model diversity, which `invoke_subagent` cannot provide because it cannot select distinct model families or specific Gemini 4 models. Do not fan out across `pro`, `flash`, and `flash_lite` to simulate diversity unless the user configured those tiers in the sheet: keep the panel on the parent model (omit `Model`) and report that model diversity was not established.
49
49
 
50
- `/setup-pstack` writes the sheet. Antigravity accepts `flash_lite`; the Copilot sheet checker rejects underscores in model IDs and does not apply to Antigravity.
50
+ `/setup-pstack` prints or updates the sheet when the user asks to configure explicit tier overrides or turn off the `SessionStart` hook. Antigravity accepts `flash_lite`; the Copilot sheet checker rejects underscores in model IDs and does not apply to Antigravity.
51
51
 
52
52
  ## Session routing hook
53
53
 
54
- Antigravity runs the plugin's `SessionStart` hook when a new session starts. The hook outputs an `injectSteps` `systemMessage` JSON payload containing the Antigravity routing mandate unless `~/.gemini/config/pstack-models.md` contains `session hook: off`.
54
+ Antigravity runs the plugin's `SessionStart` hook when a new session starts. The hook outputs an `injectSteps` `systemMessage` JSON payload containing the Antigravity routing mandate and any valid saved role lines from `~/.gemini/config/pstack-models.md` (rebuilt from checked values so the agent never needs to read that protected file), unless `~/.gemini/config/pstack-models.md` contains `session hook: off`.
55
55
 
56
56
  ## Driver and bundled skills pstack references
57
57
 
@@ -72,11 +72,11 @@ Most skills need only the tables above. These need one more mapping:
72
72
 
73
73
  | Skill | On Antigravity |
74
74
  |-------|----------------|
75
- | `interrogate` | Each adversary is an `invoke_subagent` call with `Model` from the sheet. |
76
- | `setup-pstack` | The [Other runtimes](../../setup-pstack/references/runtimes.md) table gives the sheet path. Use the `Model` values listed in [Model names](#model-names). |
77
- | `architect` | A large or contested design goes through the **arena** skill: one `invoke_subagent` call per runner, each with a `Model` from the sheet's `arena runners` line. |
75
+ | `interrogate` | Each adversary is an `invoke_subagent` call; omit `Model` (`inherit`) unless the `SessionStart` hook injected a saved `interrogate reviewers` tier override, and report that model diversity was not established when adversaries share the parent model. |
76
+ | `setup-pstack` | The [Other runtimes](../../setup-pstack/references/runtimes.md) table and its Antigravity section give the sheet path, protection-boundary fallback, and `invoke_subagent` tier values listed in [Model names](#model-names). |
77
+ | `architect` | A large or contested design goes through the **arena** skill: one `invoke_subagent` call per runner, using the `SessionStart` hook's saved `arena runners` line when present and omitting `Model` otherwise. |
78
78
  | `how` | The one read-only subagent maps to `invoke_subagent`. |
79
- | `arena` | The parallel candidates and the cross-judge map to `invoke_subagent` calls with the sheet's panel lines. |
79
+ | `arena` | The parallel candidates map to `invoke_subagent` calls; omit `Model` (`inherit`) unless the `SessionStart` hook injected a saved `arena runners` tier override. Skip the Phase C cross-family judge when all candidates and the parent share one model family, and report that Phase C was skipped. |
80
80
  | `no-comments` | Dispatch via `invoke_subagent` with `TypeName: "self"` and tell it in `Prompt` to read `poteto-mode/references/agents/comment-sicko.md` in full with `read_file` first, as Subagent policy describes. |
81
81
  | `thermos` | Dispatch two `invoke_subagent` calls with `TypeName: "research"`, telling each in `Prompt` to read `thermo-nuclear-review/SKILL.md` or `thermo-nuclear-code-quality-review/SKILL.md` in full with `read_file` first and review only the diff and file excerpts in `Prompt`. When a reviewer needs `gh` or shell access, use `TypeName: "self"` and tell it in `Prompt` not to write files. |
82
82
  | `swarm` | Each worker is an `invoke_subagent` call; use `Workspace: "share"` or `git worktree add` for writing workers. |
@@ -1,6 +1,16 @@
1
1
  import { createHash } from "node:crypto";
2
- import { existsSync, readFileSync, writeFileSync } from "node:fs";
3
- import { join } from "node:path";
2
+ import {
3
+ mkdirSync,
4
+ mkdtempSync,
5
+ readdirSync,
6
+ readFileSync,
7
+ renameSync,
8
+ rmSync,
9
+ writeFileSync,
10
+ } from "node:fs";
11
+ import { createRequire } from "node:module";
12
+ import { homedir } from "node:os";
13
+ import { basename, isAbsolute, join } from "node:path";
4
14
 
5
15
  // This tooling is bun-only (import.meta.dir, Bun.spawnSync, bun.lock). Fail with a
6
16
  // clear message instead of an opaque `import.meta.dir is undefined` crash under node.
@@ -11,61 +21,98 @@ if (typeof Bun === "undefined") {
11
21
  process.exit(1);
12
22
  }
13
23
 
14
- const scriptsDirectory = import.meta.dir;
15
- const nodeModulesDirectory = join(scriptsDirectory, "node_modules");
16
- const commanderPackagePath = join(
17
- nodeModulesDirectory,
18
- "commander",
19
- "package.json"
20
- );
21
- const installKeyPath = join(
22
- nodeModulesDirectory,
23
- ".poteto-mode-tools-install-key"
24
- );
25
-
26
- function currentInstallKey(): string {
27
- return createHash("sha256")
28
- .update(readFileSync(join(scriptsDirectory, "package.json")))
29
- .update("\0")
30
- .update(readFileSync(join(scriptsDirectory, "bun.lock")))
31
- .digest("hex");
24
+ function cacheHome(): string {
25
+ const { XDG_CACHE_HOME, LOCALAPPDATA } = process.env;
26
+ if (XDG_CACHE_HOME && isAbsolute(XDG_CACHE_HOME)) return XDG_CACHE_HOME;
27
+ if (process.platform === "win32") {
28
+ return LOCALAPPDATA && isAbsolute(LOCALAPPDATA)
29
+ ? LOCALAPPDATA
30
+ : join(homedir(), "AppData", "Local");
31
+ }
32
+ if (process.platform === "darwin") return join(homedir(), "Library", "Caches");
33
+ return join(homedir(), ".cache");
32
34
  }
33
35
 
34
- export function ensureDependenciesInstalled(): void {
35
- const installKey = currentInstallKey();
36
- if (
37
- existsSync(commanderPackagePath) &&
38
- existsSync(installKeyPath) &&
39
- readFileSync(installKeyPath, "utf8").trim() === installKey
40
- ) {
41
- return;
36
+ type CommanderModule = typeof import("commander");
37
+ const require = createRequire(import.meta.url);
38
+ let installedCommander: CommanderModule | undefined;
39
+
40
+ function readCommander(directory: string): CommanderModule | undefined {
41
+ try {
42
+ return require(join(directory, "node_modules", "commander"));
43
+ } catch (error) {
44
+ if (
45
+ typeof error === "object" &&
46
+ error !== null &&
47
+ "code" in error &&
48
+ (error.code === "MODULE_NOT_FOUND" || error.code === "ERR_MODULE_NOT_FOUND")
49
+ ) {
50
+ return undefined;
51
+ }
52
+ throw error;
42
53
  }
54
+ }
43
55
 
44
- const result = Bun.spawnSync(
45
- [process.execPath, "install", "--frozen-lockfile", "--production"],
46
- { cwd: scriptsDirectory }
47
- );
48
- if (result.exitCode !== 0) {
49
- process.stdout.write(result.stdout);
50
- process.stderr.write(result.stderr);
51
- throw new Error(
52
- `bun install --frozen-lockfile exited with status ${result.exitCode}`
53
- );
56
+ function cachedCommander(directory: string): CommanderModule | undefined {
57
+ for (const entry of readdirSync(directory, { withFileTypes: true })) {
58
+ if (!entry.isDirectory() || !entry.name.startsWith("ready-")) continue;
59
+ const commander = readCommander(join(directory, entry.name));
60
+ if (commander) return commander;
54
61
  }
55
- if (!existsSync(commanderPackagePath)) {
56
- throw new Error(
57
- "bun install --frozen-lockfile completed without installing commander"
62
+ }
63
+
64
+ function installDependencies(
65
+ directory: string,
66
+ files: { packageJson: Buffer; lockfile: Buffer }
67
+ ): CommanderModule {
68
+ const staging = mkdtempSync(join(directory, "install-"));
69
+ try {
70
+ writeFileSync(join(staging, "package.json"), files.packageJson);
71
+ writeFileSync(join(staging, "bun.lock"), files.lockfile);
72
+ const result = Bun.spawnSync(
73
+ [process.execPath, "install", "--frozen-lockfile", "--production"],
74
+ { cwd: staging }
58
75
  );
76
+ if (result.exitCode !== 0) {
77
+ process.stdout.write(result.stdout);
78
+ process.stderr.write(result.stderr);
79
+ throw new Error(
80
+ `bun install --frozen-lockfile exited with status ${result.exitCode}`
81
+ );
82
+ }
83
+ // Each ready directory is immutable. A partial eviction can be repaired
84
+ // without removing files that another invocation may still be using.
85
+ const concurrent = cachedCommander(directory);
86
+ if (concurrent) return concurrent;
87
+ const ready = join(directory, basename(staging).replace(/^install-/, "ready-"));
88
+ renameSync(staging, ready);
89
+ const commander = readCommander(ready);
90
+ if (!commander) {
91
+ throw new Error(
92
+ "bun install --frozen-lockfile completed without installing commander"
93
+ );
94
+ }
95
+ return commander;
96
+ } finally {
97
+ rmSync(staging, { recursive: true, force: true });
59
98
  }
99
+ }
60
100
 
61
- writeFileSync(installKeyPath, `${installKey}\n`);
101
+ export function ensureDependenciesInstalled(): void {
102
+ const packageJson = readFileSync(join(import.meta.dir, "package.json"));
103
+ const lockfile = readFileSync(join(import.meta.dir, "bun.lock"));
104
+ const installKey = createHash("sha256")
105
+ .update(packageJson)
106
+ .update("\0")
107
+ .update(lockfile)
108
+ .digest("hex");
109
+ const directory = join(cacheHome(), "pstack", "poteto-mode-tools", installKey);
110
+ mkdirSync(directory, { recursive: true, mode: 0o700 });
111
+ installedCommander =
112
+ cachedCommander(directory) ??
113
+ installDependencies(directory, { packageJson, lockfile });
114
+ }
62
115
 
63
- const restarted = Bun.spawnSync([process.execPath, ...process.argv.slice(1)], {
64
- cwd: process.cwd(),
65
- env: process.env,
66
- stdin: "inherit",
67
- stdout: "inherit",
68
- stderr: "inherit",
69
- });
70
- process.exit(restarted.exitCode ?? 1);
116
+ export async function loadCommander(): Promise<CommanderModule> {
117
+ return installedCommander ?? import("commander");
71
118
  }
@@ -1,11 +1,6 @@
1
1
  import { setTimeout as delay } from "node:timers/promises";
2
+ import { loadCommander } from "../bootstrap.ts";
2
3
  import { DeadlineExceeded, WatchDeadline } from "./deadline.ts";
3
- import {
4
- Command,
5
- CommanderError,
6
- InvalidArgumentError,
7
- Option,
8
- } from "commander";
9
4
  import {
10
5
  GhGitHubReader,
11
6
  WatcherQueryError,
@@ -25,6 +20,10 @@ import {
25
20
  import { renderJson, renderPretty } from "./render.ts";
26
21
  import type * as T from "./types.ts";
27
22
  import { nonEmpty, parsePrNumber } from "./types.ts";
23
+
24
+ const { Command, CommanderError, InvalidArgumentError, Option } =
25
+ await loadCommander();
26
+
28
27
  export interface CliOptions {
29
28
  readonly owner: string | null;
30
29
  readonly repo: string | null;
@@ -53,6 +53,10 @@ if (path === prefix + 'pulls/1') {
53
53
  value = { object: { sha: 'base' } };
54
54
  } else if (path === prefix + 'commits/head/check-runs?per_page=100') {
55
55
  const runs = scenario === 'failing' ? [run('build', 'success'), run('test', 'failure')]
56
+ : scenario === 'two-apps' ? [
57
+ { ...run('build', 'failure', 10, '2026-11-23T09:00:00Z'), app: { id: 10, slug: 'builder-a' } },
58
+ { ...run('build', 'success', 11), app: { id: 11, slug: 'builder-b' } },
59
+ ]
56
60
  : scenario === 'pending' ? [run('build', 'success'), run('test')]
57
61
  // A cancelled run of a workflow run that a newer one of the same workflow and event replaced.
58
62
  : scenario === 'replaced' ? [run('build', 'cancelled', 2, '2026-11-23T09:00:00Z'), run('build', 'success'), run('test', 'success')]
@@ -79,7 +83,12 @@ if (path === prefix + 'pulls/1') {
79
83
  // 12 starts a thread the route did not return.
80
84
  value = [scenario === 'missing-thread' ? [comment(11), comment(12)] : [comment(11)]];
81
85
  } else if (path === prefix + 'commits/head/check-suites?per_page=100') {
82
- value = [{ total_count: 1, check_suites: [{ id: 1, head_sha: 'head', status: 'completed', conclusion: 'success', app: { slug: 'github-actions', name: 'GitHub Actions' }, latest_check_runs_count: 2 }] }];
86
+ if (scenario === 'two-apps') {
87
+ const suites = [[10, 'builder-a', 'failure'], [11, 'builder-b', 'success']].map(([id, slug, conclusion]) => ({
88
+ id, app: { id, name: slug, slug }, head_sha: 'head', status: 'completed', conclusion, latest_check_runs_count: 1,
89
+ }));
90
+ value = [{ total_count: suites.length, check_suites: suites }];
91
+ } else value = [{ total_count: 1, check_suites: [{ id: 1, head_sha: 'head', status: 'completed', conclusion: 'success', app: { slug: 'github-actions', name: 'GitHub Actions' }, latest_check_runs_count: 2 }] }];
83
92
  } else { console.error('unexpected fixture command: ' + JSON.stringify(args)); process.exit(1); }
84
93
  console.log(JSON.stringify(value));
85
94
  `;
@@ -202,6 +211,12 @@ it("reports failing and pending check runs from REST", () => {
202
211
  });
203
212
  });
204
213
 
214
+ it("keeps a failing check when another app passes a check of the same name", () => {
215
+ const { status, verdict } = watch("two-apps");
216
+ expect(status).toBe(4);
217
+ expect(verdict.kind).toBe("BLOCKER");
218
+ });
219
+
205
220
  it("keeps only the newest run per name, workflow, and event, as gh pr checks does", () => {
206
221
  const { verdict } = watch("replaced", ["--status-only"]);
207
222
  expect(verdict.rows[0].ci).toMatchObject({ kind: "ci-clean", failed: [] });
@@ -165,10 +165,16 @@ function fastChecks(
165
165
  // CodeQL default setup (github/docs#47025), so only the agents' path is left out.
166
166
  if (String(workflow?.path ?? "").startsWith("dynamic/agents/")) continue;
167
167
  const workflowName = workflow === undefined ? "" : String(workflow.name);
168
- const event = workflow === undefined ? "" : String(workflow.event);
169
- const key = `${name}/${workflowName}/${event}`;
170
- if (seen.has(key)) continue;
171
- seen.add(key);
168
+ // REST already returns the latest check runs per suite. Only an identified
169
+ // Actions workflow tells us that one suite can supersede another.
170
+ if (workflow) {
171
+ const producer = workflow.workflow_id ?? workflow.path;
172
+ if (producer !== undefined && producer !== null) {
173
+ const key = JSON.stringify([producer, workflow.event, name]);
174
+ if (seen.has(key)) continue;
175
+ seen.add(key);
176
+ }
177
+ }
172
178
  const state = text(
173
179
  run.status === "completed" ? run.conclusion : run.status,
174
180
  "check run.conclusion"
@@ -1,9 +1,32 @@
1
1
  import { expect, it } from "bun:test";
2
2
  import { spawnSync } from "node:child_process";
3
- import { cpSync, mkdtempSync, rmSync } from "node:fs";
3
+ import { createHash } from "node:crypto";
4
+ import {
5
+ cpSync,
6
+ mkdirSync,
7
+ mkdtempSync,
8
+ readdirSync,
9
+ readFileSync,
10
+ rmSync,
11
+ statSync,
12
+ writeFileSync,
13
+ } from "node:fs";
4
14
  import { tmpdir } from "node:os";
5
15
  import { basename, join } from "node:path";
6
16
 
17
+ // Every path in the tree with a hash of each file's bytes. Codex fingerprints
18
+ // the plugin bundle, so any added, removed, or changed file re-prompts hook
19
+ // approval, not only a node_modules directory.
20
+ const bundleSnapshot = (directory: string) =>
21
+ readdirSync(directory, { recursive: true, encoding: "utf8" })
22
+ .sort()
23
+ .map((entry) => {
24
+ const path = join(directory, entry);
25
+ return statSync(path).isDirectory()
26
+ ? `${entry}/`
27
+ : `${entry} ${createHash("sha256").update(readFileSync(path)).digest("hex")}`;
28
+ });
29
+
7
30
  // A plugin update ships the scripts without node_modules, so the first run of
8
31
  // each entry point installs commander. --no-install turns off Bun's
9
32
  // auto-install, which otherwise fetches commander from the registry and hides
@@ -14,22 +37,53 @@ for (const [name, entry] of [
14
37
  ["watch-pr", "watch-pr/watch-pr"],
15
38
  ["ship-pr", "watch-pr/ship-pr"],
16
39
  ]) {
17
- it(`${name} --help runs on the first run after an install`, () => {
18
- const copy = mkdtempSync(join(tmpdir(), "poteto-mode-scripts-"));
40
+ it(`${name} --help runs without adding dependencies to the plugin`, () => {
41
+ const root = mkdtempSync(join(tmpdir(), "poteto-mode-scripts-"));
42
+ const copy = join(root, "scripts");
43
+ const cacheHome = join(root, "cache");
19
44
  try {
20
45
  cpSync(scriptsDirectory, copy, {
21
46
  recursive: true,
22
47
  filter: (source) => basename(source) !== "node_modules",
23
48
  });
24
- const result = spawnSync(
25
- process.execPath,
26
- ["--no-install", join(copy, entry), "--help"],
27
- { cwd: tmpdir(), encoding: "utf8", timeout: 60_000 }
49
+ const unrelatedPackage = join(root, "node_modules", "commander");
50
+ mkdirSync(unrelatedPackage, { recursive: true });
51
+ writeFileSync(
52
+ join(unrelatedPackage, "index.js"),
53
+ 'throw new Error("Unrelated Commander ran");\n'
28
54
  );
29
- expect(result.status, result.stderr).toBe(0);
30
- expect(result.stdout).toContain(`Usage: ${name}`);
55
+ const bundleBefore = bundleSnapshot(copy);
56
+
57
+ const runHelp = (run: string) => {
58
+ const result = spawnSync(
59
+ process.execPath,
60
+ ["--no-install", join(copy, entry), "--help"],
61
+ {
62
+ cwd: root,
63
+ encoding: "utf8",
64
+ env: { ...process.env, XDG_CACHE_HOME: cacheHome },
65
+ timeout: 20_000,
66
+ }
67
+ );
68
+ expect(result.status, `${run}: ${result.stderr}`).toBe(0);
69
+ expect(result.stdout).toContain(`Usage: ${name}`);
70
+ expect(bundleSnapshot(copy), run).toEqual(bundleBefore);
71
+ };
72
+
73
+ runHelp("first run");
74
+ runHelp("subsequent run");
75
+ const toolsCache = join(cacheHome, "pstack", "poteto-mode-tools");
76
+ const packages = readdirSync(toolsCache, {
77
+ recursive: true,
78
+ encoding: "utf8",
79
+ }).filter((path) => basename(path) === "commander");
80
+ expect(packages).toHaveLength(1);
81
+ for (const path of packages) {
82
+ rmSync(join(toolsCache, path), { recursive: true });
83
+ }
84
+ runHelp("after partial cache eviction");
31
85
  } finally {
32
- rmSync(copy, { recursive: true, force: true });
86
+ rmSync(root, { recursive: true, force: true });
33
87
  }
34
88
  }, 90_000);
35
89
  }
@@ -1,5 +1,5 @@
1
1
  import { readFile } from "node:fs/promises";
2
- import { Command, CommanderError } from "commander";
2
+ import { loadCommander } from "../bootstrap.ts";
3
3
  import { WatchDeadline } from "./deadline.ts";
4
4
  import { runJson } from "./github.ts";
5
5
  import { object, parseContext } from "./landing.ts";
@@ -11,6 +11,8 @@ import {
11
11
  type ShippingResult,
12
12
  } from "./shipping.ts";
13
13
 
14
+ const { Command, CommanderError } = await loadCommander();
15
+
14
16
  export async function main(argv: readonly string[]): Promise<number> {
15
17
  let result: ShippingResult | undefined;
16
18
  const deadline = new WatchDeadline(60, () => performance.now() / 1000);
@@ -1,8 +1,19 @@
1
- import { expect, it } from "bun:test";
1
+ import { afterAll, beforeAll, expect, it } from "bun:test";
2
2
  import { spawnSync } from "node:child_process";
3
+ import { mkdtempSync, rmSync } from "node:fs";
3
4
  import { tmpdir } from "node:os";
4
5
  import { join } from "node:path";
5
6
 
7
+ // The wrappers install commander into the user cache on first run, so give
8
+ // them a scratch cache instead of the real one. The first run may fetch
9
+ // commander from the registry, since Bun keeps its own package cache there too
10
+ // when BUN_INSTALL is unset.
11
+ let cacheHome: string;
12
+ beforeAll(() => {
13
+ cacheHome = mkdtempSync(join(tmpdir(), "poteto-mode-wrapper-cache-"));
14
+ });
15
+ afterAll(() => rmSync(cacheHome, { recursive: true, force: true }));
16
+
6
17
  for (const name of ["watch-pr", "ship-pr"]) {
7
18
  it(`${name} --help runs from a foreign working directory`, () => {
8
19
  const result = spawnSync(
@@ -11,10 +22,11 @@ for (const name of ["watch-pr", "ship-pr"]) {
11
22
  {
12
23
  cwd: tmpdir(),
13
24
  encoding: "utf8",
14
- timeout: 3000,
25
+ env: { ...process.env, XDG_CACHE_HOME: cacheHome },
26
+ timeout: 20_000,
15
27
  }
16
28
  );
17
29
  expect(result.status, result.stderr).toBe(0);
18
30
  expect(result.stdout).toContain(`Usage: ${name}`);
19
- });
31
+ }, 30_000);
20
32
  }
@@ -13,7 +13,7 @@ The role lines are the same everywhere. What differs is the sheet path, how the
13
13
  | Muse | `${XDG_CONFIG_HOME:-~/.config}/muse/pstack-models.md` | the plugin hook reads it and injects its role lines at session start, once hooks are approved; no include line | the model catalog (`muse model-profile show <model>` names each one), see [muse-tools.md](../../poteto-mode/references/muse-tools.md#model-names) | hook contract tested; plugin install verified |
14
14
  | MiniMax Code | `~/.minimax/pstack-models.md`, even when `MINIMAX_DATA_DIR` moves MiniMax's data directory, since MiniMax Code withholds that variable from hooks and its `bash` tool | model rows: read by the agent before a role-model skill, or paste into `AGENTS.md` in MiniMax Code's data directory; hook setting: read by the plugin | `mcode provider list` or the `model` slash command, see [minimax-tools.md](../../poteto-mode/references/minimax-tools.md#model-names) | hook contract tested; plugin load smoke-tested on 0.7.4; no live session |
15
15
  | Kimi Code CLI | `<KIMI_CODE_HOME>/pstack-models.md`, or `~/.kimi-code/pstack-models.md` when unset | read by the agent before a role-model skill; no hook setting | the `Agent` tool's model parameter when available, see [kimi-tools.md](../../poteto-mode/references/kimi-tools.md#model-names) | installation and synthetic-provider context delivery checked on Kimi 2.4.1 for macOS; model compliance untested |
16
- | Antigravity (`agy`) | `~/.gemini/config/pstack-models.md` | model rows: read by the agent before a role-model skill, or paste into `~/.gemini/config/AGENTS.md`; hook setting: read by the plugin's `SessionStart` hook | `invoke_subagent`'s `Model` enum (`inherit`, `flash_lite`, `flash`, `pro`), see [agy-tools.md](../../poteto-mode/references/agy-tools.md#model-names) | tested with `agy` 1.5.0 on macOS: plugin install, hook on/off, full skill read and a live subagent reply; Windows untested |
16
+ | Antigravity (`agy`) | `~/.gemini/config/pstack-models.md` | the plugin's `SessionStart` hook reads it outside Antigravity's protection boundary and injects valid role lines at session start, and reads `session hook: off`; skills-only installs can paste role lines into `AGENTS.md` or `GEMINI.md` | `invoke_subagent`'s `Model` tier enum (`inherit`, `flash_lite`, `flash`, `pro`; defaults to `inherit` for the parent session's active model), see [agy-tools.md](../../poteto-mode/references/agy-tools.md#model-names) | tested with `agy` 1.5.0 on macOS: plugin install, hook on/off, full skill read and a live subagent reply; Windows untested |
17
17
  | OMP | `~/.omp/pstack-models.md` (global across profiles; hook only) | read by the OMP plugin for routing | `omp models --kind chat`; model roles use OMP configuration, see [omp-tools.md](../../poteto-mode/references/omp-tools.md#model-names) | installation, skill access, and the routing toggle checked on OMP 18.16.0 with a synthetic provider; model compliance untested |
18
18
  | Grok Build | `${GROK_HOME:-~/.grok}/pstack-models.md` | read by the agent before a role-model skill; the `session hook` line does not control the Grok routing hint | the `spawn_subagent` tool's advertised models; use overrides only at the user's explicit request; see [grok.md](../../poteto-mode/references/grok.md#model-names) | synthetic-provider plugin and skill loading tested |
19
19
  | OpenCode 2 | `${XDG_CONFIG_HOME:-~/.config}/opencode/pstack-models.md` | add the path to the `instructions` array in `opencode.jsonc`; the plugin reads the hook setting directly | the `models` command in the session; see [opencode-tools.md](../../poteto-mode/references/opencode-tools.md#model-names) | native skill activation and routing tested on 2.2.5 with a loopback provider |
@@ -50,7 +50,8 @@ Follow [the Copilot setup](../copilot.md); its opening names the steps it replac
50
50
 
51
51
  ## Antigravity
52
52
 
53
- - **Steps 3 and 5 (effort, validate).** `invoke_subagent` takes a `Model` and no effort parameter. Skip the effort questions in step 3 and effort validation in step 5, and omit the `default effort` line and `@<level>` suffixes.
53
+ - **Steps 2, 6, and 7 (protected path).** `~/.gemini/config/pstack-models.md` sits behind Antigravity's system protection boundary, so agent file tools may be blocked from reading or writing it directly. When reading is blocked, start from `inherit` (or any role lines injected by `SessionStart`). When writing is blocked, print the exact sheet path and full file contents for the user to save; the plugin's `SessionStart` hook injects valid role lines on the next session, so no include line in `AGENTS.md` is needed when the plugin hook is active (skills-only installs can paste the role lines into `AGENTS.md` or `GEMINI.md`).
54
+ - **Steps 3 and 5 (effort, validate).** `invoke_subagent` takes a `Model` tier enum (`inherit`, `flash_lite`, `flash`, `pro`) and no effort parameter. Skip the effort questions in step 3 and effort validation in step 5, and omit the `default effort` line and `@<level>` suffixes. Default roles to `inherit` (or `inherit-parent` / `auto`) unless the user explicitly wants a fixed tier (`pro`, `flash`, `flash_lite`).
54
55
 
55
56
  ## Kimi Code CLI
56
57
 
@@ -1,7 +1,7 @@
1
1
  # Reads and checks a pstack model sheet. Shared by check-sheet.sh, which
2
2
  # setup-pstack runs after it writes a GitHub Copilot sheet, by the Copilot
3
3
  # plugin hooks, which check the sheet again each time they read it, and by the
4
- # Muse SessionStart hook. POSIX awk, run under LC_ALL=C.
4
+ # Muse and Antigravity SessionStart hooks. POSIX awk, run under LC_ALL=C.
5
5
 
6
6
  # Fills roles[1..n] with the roles every sheet names, in sheet order, and
7
7
  # panel[role] for the panel lists, and SHEET_EFFORT[level] for the reasoning