@howaboua/pi-subagent-review 0.2.15 → 0.2.17

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 ADDED
@@ -0,0 +1,152 @@
1
+ # @howaboua/pi-subagent-review
2
+
3
+ ## 0.2.17
4
+
5
+ ### Changes
6
+
7
+ - [#301](https://github.com/IgorWarzocha/howaboua-pi-stuff/pull/301) [`8456135`](https://github.com/IgorWarzocha/howaboua-pi-stuff/commit/8456135c54113c01541c8ee8874baa1bd9eefa59) Thanks [@IgorWarzocha](https://github.com/IgorWarzocha)! - Preserve the review findings UI while restoring the `before_agent_start` lifecycle when `/review` is the first session message.
8
+
9
+ - Keep findings custom-rendered, then use a normal user turn for verification and disposition.
10
+ - Direct the agent to verify findings against the cited code, request user dispositions, and begin agreed work without resummarizing.
11
+ - End cleanly without a disposition turn when the reviewer finds no actionable issues.
12
+ - Show this package’s unseen release notes in the shared startup card, with a global suppression setting.
13
+
14
+ ## 0.2.16
15
+
16
+ ### Changes
17
+
18
+ - [#269](https://github.com/IgorWarzocha/howaboua-pi-stuff/pull/269) [`6138ffd`](https://github.com/IgorWarzocha/howaboua-pi-stuff/commit/6138ffd735bb4f7f80e451320dbfd0933a4acaa7) Thanks [@howaclawa](https://github.com/howaclawa)!:
19
+ - Add shared realtime voice prompts for ask prompts, Auto Trees, Shepherdr settlements, and review progress.
20
+ - Announce compaction and stream conversational Pi updates after two sentences.
21
+ - Keep silent tool-step summaries compatible without exposing Chat Completions thinking content.
22
+ - Configure delegation acknowledgements and deliver V3 delegations immediately.
23
+ - Preserve late delegations, calls after data-channel closure, prepared Code Mode prompts, and Codex cache continuity.
24
+ - Reduce LAN playback dropouts with one more jitter-buffer frame.
25
+
26
+ ## 0.2.15
27
+
28
+ ### Changes
29
+
30
+ - [#235](https://github.com/IgorWarzocha/howaboua-pi-stuff/pull/235) [`5657b77`](https://github.com/IgorWarzocha/howaboua-pi-stuff/commit/5657b778f59ffa2eb86f10f7e949f060d95eb993) Thanks [@IgorWarzocha](https://github.com/IgorWarzocha)!:
31
+ - Preserve Pi 0.84 credential-resolved endpoints and nullable auth headers in summaries.
32
+ - Assemble complete multi-block, delta-only RPC streaming updates.
33
+ - Remove retired Smart BTW shortcut-capture and voice-helper exports.
34
+
35
+ ## 0.2.14
36
+
37
+ ### Changes
38
+
39
+ - [#198](https://github.com/IgorWarzocha/howaboua-pi-stuff/pull/198) [`05f2da3`](https://github.com/IgorWarzocha/howaboua-pi-stuff/commit/05f2da3e7b540d30eaada94c527b6ecbef80f736) Thanks [@IgorWarzocha](https://github.com/IgorWarzocha)!:
40
+ - Replace the review subprocess transport with Pi's maintained RPC client, preserve failed-run diagnostics, prevent review-loop bookkeeping from creating empty summaries, and reissue guidance for each fresh review loop
41
+
42
+ ## 0.2.13
43
+
44
+ ### Changes
45
+
46
+ - [#184](https://github.com/IgorWarzocha/howaboua-pi-stuff/pull/184) [`18868c1`](https://github.com/IgorWarzocha/howaboua-pi-stuff/commit/18868c1ba0257f7d6ddeeb7dfc51f3af467e4633) Thanks [@IgorWarzocha](https://github.com/IgorWarzocha)!:
47
+ - Use the configurable lightweight model for tree summaries.
48
+ - Clarify workflow, review-context, summary-session, and RPC protocol ownership.
49
+
50
+ ## 0.2.12
51
+
52
+ ### Changes
53
+
54
+ - [#146](https://github.com/IgorWarzocha/howaboua-pi-stuff/pull/146) [`799a4b2`](https://github.com/IgorWarzocha/howaboua-pi-stuff/commit/799a4b24e5b49a1020c95524209c01112625aa6b) Thanks [@IgorWarzocha](https://github.com/IgorWarzocha)!:
55
+ - Reinjects the review advisory preface when compaction has removed the earlier preface from active session context.
56
+
57
+ ## 0.2.11
58
+
59
+ ### Changes
60
+
61
+ - [#131](https://github.com/IgorWarzocha/howaboua-pi-stuff/pull/131) [`828f52e`](https://github.com/IgorWarzocha/howaboua-pi-stuff/commit/828f52eff1291629d73c3058173cff2fa60e3b28) Thanks [@IgorWarzocha](https://github.com/IgorWarzocha)!:
62
+ - Adds Pi 0.80.8 compatibility for Codex device login and review-session model runtime handling.
63
+
64
+ ## 0.2.10
65
+
66
+ ### Changes
67
+
68
+ - [#106](https://github.com/IgorWarzocha/howaboua-pi-stuff/pull/106) [`c423031`](https://github.com/IgorWarzocha/howaboua-pi-stuff/commit/c4230312f24db0e49c95eafff959109d74017c3d) Thanks [@IgorWarzocha](https://github.com/IgorWarzocha)!:
69
+ - Rewrite package documentation around current installation, configuration, usage, and behavior.
70
+
71
+ ## 0.2.9
72
+
73
+ ### Changes
74
+
75
+ - [#97](https://github.com/IgorWarzocha/howaboua-pi-stuff/pull/97) [`40ea35b`](https://github.com/IgorWarzocha/howaboua-pi-stuff/commit/40ea35bbdb8c0437b57bd0dc7ddc41dbc21d2cf5) Thanks [@IgorWarzocha](https://github.com/IgorWarzocha)!:
76
+ - Uses Pi's compaction-aware active session entries when preparing review conversation summaries, preventing superseded history from overflowing the summary model.
77
+
78
+ ## 0.2.8
79
+
80
+ ### Changes
81
+
82
+ - [#92](https://github.com/IgorWarzocha/howaboua-pi-stuff/pull/92) [`68ceda7`](https://github.com/IgorWarzocha/howaboua-pi-stuff/commit/68ceda7ee01203df93d181cd940dc1b64d93739d) Thanks [@IgorWarzocha](https://github.com/IgorWarzocha)!:
83
+ - Add bundled promoted examples for subagents, vent logging, workflow creation, and semantic grep.
84
+ - Require each subagent to perform its assigned role without further delegation.
85
+
86
+ ## 0.2.7
87
+
88
+ ### Changes
89
+
90
+ - [#79](https://github.com/IgorWarzocha/howaboua-pi-stuff/pull/79) [`dc0d253`](https://github.com/IgorWarzocha/howaboua-pi-stuff/commit/dc0d25382e1b650e024cc235e23ea62117784e23) Thanks [@IgorWarzocha](https://github.com/IgorWarzocha)!:
91
+ - Uses GPT-5.6 Sol for reviews and GPT-5.6 Luna for conversation summaries by default.
92
+
93
+ ## 0.2.6
94
+
95
+ ### Changes
96
+
97
+ - [#77](https://github.com/IgorWarzocha/howaboua-pi-stuff/pull/77) [`4be919f`](https://github.com/IgorWarzocha/howaboua-pi-stuff/commit/4be919fea3c8ef6aba79f4a66907bc80d30908d4) Thanks [@IgorWarzocha](https://github.com/IgorWarzocha)!:
98
+ - Runs review summaries through Pi's public session SDK and uses settled RPC completion with Pi 0.80.6 thinking levels.
99
+
100
+ ## 0.2.5
101
+
102
+ ### Changes
103
+
104
+ - [#71](https://github.com/IgorWarzocha/howaboua-pi-stuff/pull/71) [`2a4371b`](https://github.com/IgorWarzocha/howaboua-pi-stuff/commit/2a4371b67bcf69f5237152e087c6998b4810ab5a) Thanks [@IgorWarzocha](https://github.com/IgorWarzocha)!:
105
+ - Fixes Pi 0.80 extension loading for review summary model calls.
106
+
107
+ ## 0.2.4
108
+
109
+ ### Changes
110
+
111
+ - [#67](https://github.com/IgorWarzocha/howaboua-pi-stuff/pull/67) [`1a4302a`](https://github.com/IgorWarzocha/howaboua-pi-stuff/commit/1a4302ad02a122480aeba29deacaa6f8925571ad) Thanks [@IgorWarzocha](https://github.com/IgorWarzocha)!:
112
+ - Updates Pi core package compatibility for Pi 0.80.1 and migrates summary model calls to the Pi 0.80 raw API entrypoints.
113
+
114
+ ## 0.2.3
115
+
116
+ ### Changes
117
+
118
+ - [#42](https://github.com/IgorWarzocha/howaboua-pi-stuff/pull/42) [`f380d72`](https://github.com/IgorWarzocha/howaboua-pi-stuff/commit/f380d721c2fbd9956d730cae456aa7f38e4f0546) Thanks [@IgorWarzocha](https://github.com/IgorWarzocha)!:
119
+ - Bump Pi peer and runtime dependencies to 0.79.0.
120
+ - Treat isolated review findings as advisory input, not automatic implementation work.
121
+
122
+ ## 0.2.2
123
+
124
+ ### Changes
125
+
126
+ - [#22](https://github.com/IgorWarzocha/howaboua-pi-stuff/pull/22) [`cf0ca88`](https://github.com/IgorWarzocha/howaboua-pi-stuff/commit/cf0ca88feee5175cebda37043b0a0bfb5ad913d2) Thanks [@IgorWarzocha](https://github.com/IgorWarzocha)!:
127
+ - Keep the review-loop advisory preface in history during summarization.
128
+ - Send review findings as custom review messages on every path.
129
+ - Harden Smart BTW slot bounds and answer handling.
130
+ - Improve subdirectory context discovery from shell output.
131
+ - Remove the missing file from the skills aggregate manifest.
132
+
133
+ ## 0.2.1
134
+
135
+ ### Changes
136
+
137
+ - [#19](https://github.com/IgorWarzocha/howaboua-pi-stuff/pull/19) [`d312d81`](https://github.com/IgorWarzocha/howaboua-pi-stuff/commit/d312d81f82e24645f7cc59f4b6ead1834afd19f9) Thanks [@IgorWarzocha](https://github.com/IgorWarzocha)!:
138
+ - Expose package-root extension entrypoints so aggregate extension packages can import dependency versions through normal package resolution.
139
+
140
+ ## 0.2.0
141
+
142
+ ### Changes
143
+
144
+ - [#15](https://github.com/IgorWarzocha/howaboua-pi-stuff/pull/15) [`26d4e8b`](https://github.com/IgorWarzocha/howaboua-pi-stuff/commit/26d4e8b89fb050463bf5cf3486ba1fa0ba84d8b3) Thanks [@IgorWarzocha](https://github.com/IgorWarzocha)!:
145
+ - Add `/review loop` markers that summarize completed review-fix increments before the next review pass.
146
+
147
+ ## 0.1.53
148
+
149
+ ### Changes
150
+
151
+ - [#1](https://github.com/IgorWarzocha/howaboua-pi-stuff/pull/1) [`d57f0cb`](https://github.com/IgorWarzocha/howaboua-pi-stuff/commit/d57f0cbb5b92ce5cb7cf4736b6012c5ff0bebaae) Thanks [@IgorWarzocha](https://github.com/IgorWarzocha)!:
152
+ - Fix TypeScript errors under the shared workspace typecheck settings.
package/changelog.ts ADDED
@@ -0,0 +1,327 @@
1
+ // Generated extension packages copy this file during changelog:extensions.
2
+
3
+ import { randomUUID } from "node:crypto";
4
+ import { readFileSync } from "node:fs";
5
+ import { mkdir, readFile, rename, rm, stat, writeFile } from "node:fs/promises";
6
+ import { dirname, join } from "node:path";
7
+ import { fileURLToPath } from "node:url";
8
+ import {
9
+ DynamicBorder,
10
+ type ExtensionAPI,
11
+ getAgentDir,
12
+ getMarkdownTheme,
13
+ } from "@earendil-works/pi-coding-agent";
14
+ import { Container, Markdown, Spacer, Text } from "@earendil-works/pi-tui";
15
+
16
+ const ENTRY_TYPE = "@howaboua/pi-stuff/changelog";
17
+ const REGISTRATION_CHANNEL = "@howaboua/pi-stuff/changelog/register/v1";
18
+ const STATE_FILENAME = "howaboua-pi-stuff-changelog.json";
19
+ const SUPPRESS_KEY = "suppress";
20
+ const LOCK_STALE_MS = 30_000;
21
+ const LOCK_TIMEOUT_MS = 2_000;
22
+
23
+ interface PackageMetadata {
24
+ name: string;
25
+ version: string;
26
+ }
27
+
28
+ interface PackageRegistration extends PackageMetadata {
29
+ changelogPath: string;
30
+ }
31
+
32
+ interface RegistrationEvent {
33
+ accept: () => void;
34
+ registration: PackageRegistration;
35
+ }
36
+
37
+ interface ChangelogEntry {
38
+ content: string;
39
+ version: string;
40
+ }
41
+
42
+ interface ChangelogEntryData {
43
+ markdown: string;
44
+ }
45
+
46
+ type ChangelogState = Record<string, boolean | string>;
47
+
48
+ function packageRegistration(): PackageRegistration {
49
+ const packageDirectory = fileURLToPath(new URL(".", import.meta.url));
50
+ const metadata = JSON.parse(
51
+ readFileSync(join(packageDirectory, "package.json"), "utf8"),
52
+ ) as Partial<PackageMetadata>;
53
+ if (typeof metadata.name !== "string" || typeof metadata.version !== "string")
54
+ throw new Error(`Invalid package metadata in ${packageDirectory}`);
55
+ return {
56
+ name: metadata.name,
57
+ version: metadata.version,
58
+ changelogPath: join(packageDirectory, "CHANGELOG.md"),
59
+ };
60
+ }
61
+
62
+ function isRegistrationEvent(value: unknown): value is RegistrationEvent {
63
+ if (!value || typeof value !== "object") return false;
64
+ const event = value as Partial<RegistrationEvent>;
65
+ return (
66
+ typeof event.accept === "function" &&
67
+ typeof event.registration?.name === "string" &&
68
+ typeof event.registration.version === "string" &&
69
+ typeof event.registration.changelogPath === "string"
70
+ );
71
+ }
72
+
73
+ function parseChangelog(markdown: string): ChangelogEntry[] {
74
+ const entries: ChangelogEntry[] = [];
75
+ let currentLines: string[] = [];
76
+ let currentVersion: string | undefined;
77
+
78
+ for (const line of markdown.split("\n")) {
79
+ const version = line.match(/^##\s+\[?(\d+\.\d+\.\d+)\]?(?:\s.*)?$/)?.[1];
80
+ if (version) {
81
+ if (currentVersion)
82
+ entries.push({
83
+ content: currentLines.join("\n").trim(),
84
+ version: currentVersion,
85
+ });
86
+ currentVersion = version;
87
+ currentLines = [line];
88
+ } else if (currentVersion) {
89
+ currentLines.push(line);
90
+ }
91
+ }
92
+
93
+ if (currentVersion)
94
+ entries.push({
95
+ content: currentLines.join("\n").trim(),
96
+ version: currentVersion,
97
+ });
98
+ return entries;
99
+ }
100
+
101
+ function compareVersions(left: string, right: string): number {
102
+ const leftParts = left.split(".").map(Number);
103
+ const rightParts = right.split(".").map(Number);
104
+ for (let index = 0; index < 3; index++) {
105
+ const difference = (leftParts[index] ?? 0) - (rightParts[index] ?? 0);
106
+ if (difference !== 0) return difference;
107
+ }
108
+ return 0;
109
+ }
110
+
111
+ function isStableVersion(version: string): boolean {
112
+ return /^\d+\.\d+\.\d+$/.test(version);
113
+ }
114
+
115
+ function statePath(): string {
116
+ return join(getAgentDir(), STATE_FILENAME);
117
+ }
118
+
119
+ async function readState(path: string): Promise<ChangelogState> {
120
+ let text: string;
121
+ try {
122
+ text = await readFile(path, "utf8");
123
+ } catch (error) {
124
+ if ((error as NodeJS.ErrnoException).code === "ENOENT") return {};
125
+ throw error;
126
+ }
127
+ const parsed = JSON.parse(text) as unknown;
128
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
129
+ throw new Error(`${path} must contain a JSON object`);
130
+ for (const [name, value] of Object.entries(parsed)) {
131
+ if (name === SUPPRESS_KEY) {
132
+ if (typeof value !== "boolean")
133
+ throw new Error(`${path} ${SUPPRESS_KEY} must be a boolean`);
134
+ } else if (typeof value !== "string") {
135
+ throw new Error(`${path} version for ${name} must be a string`);
136
+ }
137
+ }
138
+ return parsed as ChangelogState;
139
+ }
140
+
141
+ async function acquireLock(path: string): Promise<() => Promise<void>> {
142
+ const deadline = Date.now() + LOCK_TIMEOUT_MS;
143
+ while (true) {
144
+ try {
145
+ await mkdir(path);
146
+ return () => rm(path, { force: true, recursive: true });
147
+ } catch (error) {
148
+ if ((error as NodeJS.ErrnoException).code !== "EEXIST") throw error;
149
+ const info = await stat(path).catch(() => undefined);
150
+ if (info && Date.now() - info.mtimeMs > LOCK_STALE_MS) {
151
+ await rm(path, { force: true, recursive: true });
152
+ continue;
153
+ }
154
+ if (Date.now() >= deadline)
155
+ throw new Error(`Timed out waiting for ${path}`);
156
+ await new Promise((resolve) => setTimeout(resolve, 20));
157
+ }
158
+ }
159
+ }
160
+
161
+ async function writeState(path: string, state: ChangelogState): Promise<void> {
162
+ await mkdir(dirname(path), { mode: 0o700, recursive: true });
163
+ const temporaryPath = `${path}.${process.pid}.${randomUUID()}.tmp`;
164
+ try {
165
+ const ordered = Object.fromEntries(
166
+ Object.entries(state).sort(([left], [right]) =>
167
+ left.localeCompare(right),
168
+ ),
169
+ );
170
+ await writeFile(temporaryPath, `${JSON.stringify(ordered, null, 2)}\n`, {
171
+ encoding: "utf8",
172
+ mode: 0o600,
173
+ });
174
+ await rename(temporaryPath, path);
175
+ } catch (error) {
176
+ await rm(temporaryPath, { force: true });
177
+ throw error;
178
+ }
179
+ }
180
+
181
+ function packageMarkdown(
182
+ registration: PackageRegistration,
183
+ entries: ChangelogEntry[],
184
+ ): string {
185
+ return [
186
+ `## ${registration.name}`,
187
+ ...entries.map((entry) => entry.content.replace(/^##\s+/, "### ")),
188
+ ].join("\n\n");
189
+ }
190
+
191
+ async function claimUpdates(
192
+ registrations: Iterable<PackageRegistration>,
193
+ ): Promise<{ errors: string[]; markdown?: string }> {
194
+ const stableRegistrations = [...registrations]
195
+ .filter((registration) => isStableVersion(registration.version))
196
+ .sort((left, right) => left.name.localeCompare(right.name));
197
+ if (stableRegistrations.length === 0) return { errors: [] };
198
+ const path = statePath();
199
+ await mkdir(dirname(path), { mode: 0o700, recursive: true });
200
+ const release = await acquireLock(`${path}.lock`);
201
+ try {
202
+ const state = await readState(path);
203
+ const errors: string[] = [];
204
+ const sections: string[] = [];
205
+ let changed = false;
206
+ if (state[SUPPRESS_KEY] === true) {
207
+ for (const registration of stableRegistrations) {
208
+ const seenVersion = state[registration.name];
209
+ if (
210
+ typeof seenVersion !== "string" ||
211
+ compareVersions(registration.version, seenVersion) > 0
212
+ ) {
213
+ state[registration.name] = registration.version;
214
+ changed = true;
215
+ }
216
+ }
217
+ if (changed) await writeState(path, state);
218
+ return { errors };
219
+ }
220
+ for (const registration of stableRegistrations) {
221
+ const seenVersion = state[registration.name];
222
+ if (
223
+ typeof seenVersion === "string" &&
224
+ compareVersions(registration.version, seenVersion) <= 0
225
+ )
226
+ continue;
227
+ try {
228
+ const entries = parseChangelog(
229
+ await readFile(registration.changelogPath, "utf8"),
230
+ ).filter(
231
+ (entry) =>
232
+ compareVersions(entry.version, registration.version) <= 0 &&
233
+ (typeof seenVersion === "string"
234
+ ? compareVersions(entry.version, seenVersion) > 0
235
+ : entry.version === registration.version),
236
+ );
237
+ if (entries.length === 0) {
238
+ errors.push(
239
+ `No ${registration.version} changelog entry found for ${registration.name}`,
240
+ );
241
+ continue;
242
+ }
243
+ sections.push(packageMarkdown(registration, entries));
244
+ state[registration.name] = registration.version;
245
+ changed = true;
246
+ } catch (error) {
247
+ errors.push(
248
+ `Could not read the ${registration.name} changelog: ${error instanceof Error ? error.message : String(error)}`,
249
+ );
250
+ }
251
+ }
252
+ if (changed) await writeState(path, state);
253
+ return {
254
+ errors,
255
+ ...(sections.length > 0 ? { markdown: sections.join("\n\n") } : {}),
256
+ };
257
+ } finally {
258
+ await release();
259
+ }
260
+ }
261
+
262
+ function registerCoordinator(
263
+ pi: ExtensionAPI,
264
+ registration: PackageRegistration,
265
+ ): void {
266
+ let accepted = false;
267
+ pi.events.emit(REGISTRATION_CHANNEL, {
268
+ registration,
269
+ accept: () => {
270
+ accepted = true;
271
+ },
272
+ } satisfies RegistrationEvent);
273
+ if (accepted) return;
274
+
275
+ const registrations = new Map([[registration.name, registration]]);
276
+ pi.events.on(REGISTRATION_CHANNEL, (value) => {
277
+ if (!isRegistrationEvent(value)) return;
278
+ registrations.set(value.registration.name, value.registration);
279
+ value.accept();
280
+ });
281
+ pi.registerEntryRenderer<ChangelogEntryData>(
282
+ ENTRY_TYPE,
283
+ (entry, _options, theme) => {
284
+ if (!entry.data) return undefined;
285
+ const container = new Container();
286
+ container.addChild(new DynamicBorder());
287
+ container.addChild(
288
+ new Text(theme.bold(theme.fg("accent", "What's New")), 1, 0),
289
+ );
290
+ container.addChild(new Spacer(1));
291
+ container.addChild(
292
+ new Markdown(entry.data.markdown.trim(), 1, 0, getMarkdownTheme()),
293
+ );
294
+ container.addChild(new Spacer(1));
295
+ container.addChild(new DynamicBorder());
296
+ return container;
297
+ },
298
+ );
299
+ pi.on("session_start", async (event, ctx) => {
300
+ if (event.reason === "reload" || ctx.mode !== "tui") return;
301
+ if (
302
+ ctx.sessionManager
303
+ .getEntries()
304
+ .some((entry) =>
305
+ ["branch_summary", "compaction", "message"].includes(entry.type),
306
+ )
307
+ )
308
+ return;
309
+ try {
310
+ const update = await claimUpdates(registrations.values());
311
+ if (update.markdown)
312
+ pi.appendEntry<ChangelogEntryData>(ENTRY_TYPE, {
313
+ markdown: update.markdown,
314
+ });
315
+ for (const error of update.errors) ctx.ui.notify(error, "warning");
316
+ } catch (error) {
317
+ ctx.ui.notify(
318
+ `Could not update Howaboua changelog state: ${error instanceof Error ? error.message : String(error)}`,
319
+ "warning",
320
+ );
321
+ }
322
+ });
323
+ }
324
+
325
+ export default function howabouaPackageChangelog(pi: ExtensionAPI): void {
326
+ registerCoordinator(pi, packageRegistration());
327
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@howaboua/pi-subagent-review",
3
- "version": "0.2.15",
3
+ "version": "0.2.17",
4
4
  "description": "Pi extension that adds /review via an isolated review subagent.",
5
5
  "type": "module",
6
6
  "main": "index.ts",
@@ -12,7 +12,9 @@
12
12
  "review.prompt.md",
13
13
  "README.md",
14
14
  "tsconfig.json",
15
- "biome.json"
15
+ "biome.json",
16
+ "changelog.ts",
17
+ "CHANGELOG.md"
16
18
  ],
17
19
  "keywords": [
18
20
  "pi-package",
@@ -34,12 +36,14 @@
34
36
  },
35
37
  "pi": {
36
38
  "extensions": [
39
+ "./changelog.ts",
37
40
  "./index.ts"
38
41
  ]
39
42
  },
40
43
  "peerDependencies": {
41
44
  "@earendil-works/pi-ai": ">=0.80.8",
42
- "@earendil-works/pi-coding-agent": ">=0.82.0"
45
+ "@earendil-works/pi-coding-agent": ">=0.82.0",
46
+ "@earendil-works/pi-tui": "*"
43
47
  },
44
48
  "scripts": {
45
49
  "check": "bun run lint && bun run typecheck && bun run test",
@@ -50,8 +54,8 @@
50
54
  "format": "biome check --write ."
51
55
  },
52
56
  "devDependencies": {
53
- "@earendil-works/pi-ai": "0.84.0",
54
- "@earendil-works/pi-coding-agent": "0.84.0",
57
+ "@earendil-works/pi-ai": "0.84.1",
58
+ "@earendil-works/pi-coding-agent": "0.84.1",
55
59
  "@types/node": "^24.10.0",
56
60
  "typescript": "^5.9.3",
57
61
  "@biomejs/biome": "^2.4.16"
package/src/config.ts CHANGED
@@ -16,7 +16,7 @@ import type {
16
16
  ThinkingLevel,
17
17
  } from "./types.js";
18
18
 
19
- export function normalizeThinking(
19
+ function normalizeThinking(
20
20
  value: ThinkingLevel | undefined,
21
21
  fallback: ThinkingLevel = DEFAULT_CONFIG.thinking,
22
22
  ): ThinkingLevel {
package/src/messages.ts CHANGED
@@ -9,6 +9,8 @@ import {
9
9
  } from "./constants.js";
10
10
  import type { ReviewContext } from "./types.js";
11
11
 
12
+ const REALTIME_VOICE_PROMPT_CHANNEL =
13
+ "@howaboua/pi-codex-conversion/realtime-voice-prompt/v1";
12
14
  const REVIEW_LOOP_PREFACE_MESSAGE = [
13
15
  "A review subagent is about to inspect the repository in isolation. Its findings are advisory only and may be wrong, overbroad, or missing session context.",
14
16
  "",
@@ -16,17 +18,52 @@ const REVIEW_LOOP_PREFACE_MESSAGE = [
16
18
  "",
17
19
  "When findings return, compare each one against the user’s actual request, prior conversation, accepted decisions, intentional tradeoffs from this session, and the current implementation.",
18
20
  "",
19
- "Default response: summarize and triage, not code.",
21
+ "Default response: verify and triage, not code.",
20
22
  "",
21
- "For each finding, mark one of:",
23
+ "For each verified finding, recommend one of:",
22
24
  "",
23
25
  "- address: concrete, in-scope, necessary for the current implementation",
24
26
  "- defer: plausible but outside the current work",
25
27
  "- skip: stylistic, speculative, preference-based, overengineered, or not useful",
26
28
  "",
27
- "Only after triage, explain what you recommend doing next. If a finding is not obviously required for the current implementation, do not change code for it.",
29
+ "After triage, obtain the user’s disposition. If a finding is not obviously required for the current implementation, recommend deferring or skipping it.",
28
30
  ].join("\n");
29
31
 
32
+ const REVIEW_SUMMARY_STARTED_PROMPT =
33
+ "The current conversation is being summarised to prepare context for an isolated code review. Please announce this briefly in your natural voice.";
34
+ const REVIEW_FINDINGS_READY_PROMPT =
35
+ "The isolated code review has finished, and its findings have been sent to the main agent for triage. Announce this briefly in your natural voice. When the main agent responds, continue with its substantive triage without repeating this status.";
36
+ const REVIEW_FINDINGS_FOLLOW_UP = [
37
+ "Treat the findings above as advisory and unverified. Read the cited files and trace the relevant paths before deciding whether each finding is true, necessary, and in scope. Compare them against the user’s request, prior decisions, and current implementation. Do not merely summarize the reviewer output.",
38
+ "",
39
+ "Before changing code, get the user’s disposition on the verified findings using an available ask/questions tool, or a normal message if none is available. After dispositions are agreed, do not summarize them again: start the agreed work. If any remain ambiguous, complete the clear, simple, non-blocking agreed fixes first, then return to the ambiguous findings.",
40
+ ].join("\n");
41
+
42
+ function announceReviewStatus(
43
+ pi: ExtensionAPI,
44
+ id: string,
45
+ prompt: string,
46
+ ): void {
47
+ pi.events.emit(REALTIME_VOICE_PROMPT_CHANNEL, { id, active: true, prompt });
48
+ pi.events.emit(REALTIME_VOICE_PROMPT_CHANNEL, { id, active: false, prompt });
49
+ }
50
+
51
+ export function announceReviewSummaryStarted(pi: ExtensionAPI): void {
52
+ announceReviewStatus(
53
+ pi,
54
+ "pi-subagent-review:summary-started",
55
+ REVIEW_SUMMARY_STARTED_PROMPT,
56
+ );
57
+ }
58
+
59
+ export function announceReviewFindingsReady(pi: ExtensionAPI): void {
60
+ announceReviewStatus(
61
+ pi,
62
+ "pi-subagent-review:findings-ready",
63
+ REVIEW_FINDINGS_READY_PROMPT,
64
+ );
65
+ }
66
+
30
67
  function getReviewPrefaceMessageId(
31
68
  ctx: ExtensionCommandContext,
32
69
  ): string | undefined {
@@ -70,7 +107,7 @@ function buildReviewScopeText(review: ReviewContext): string {
70
107
  return `for current repository state in \`${review.repoRoot}\` with no usable base branch or merge base`;
71
108
  }
72
109
 
73
- function buildReviewUserMessage(
110
+ function buildReviewFindingsMessage(
74
111
  review: ReviewContext,
75
112
  findings: string,
76
113
  ): string {
@@ -78,14 +115,6 @@ function buildReviewUserMessage(
78
115
  `Review findings from /${REVIEW_COMMAND} ${buildReviewScopeText(review)}:`,
79
116
  "",
80
117
  findings.trim() || "No actionable issues found.",
81
- "",
82
- "These findings are advisory output from an isolated review subagent.",
83
- "",
84
- "Do not treat review findings as a TODO list. Default response: summarize and triage, not code.",
85
- "",
86
- "Compare each finding against the user’s actual request, prior conversation, accepted decisions, intentional tradeoffs from this session, and the current implementation.",
87
- "",
88
- "Mark each finding as address, defer, or skip. Only change code for findings that are obviously required for the current implementation.",
89
118
  ].join("\n");
90
119
  }
91
120
 
@@ -95,13 +124,24 @@ export function sendReviewFindings(
95
124
  review: ReviewContext,
96
125
  findings: string,
97
126
  ): void {
127
+ const normalizedFindings = findings.trim();
128
+ const idle = ctx.isIdle();
98
129
  pi.sendMessage(
99
130
  {
100
131
  customType: REVIEW_FINDINGS_MESSAGE_TYPE,
101
- content: buildReviewUserMessage(review, findings),
132
+ content: buildReviewFindingsMessage(review, findings),
102
133
  display: true,
103
134
  details: { repoRoot: review.repoRoot, scope: review.scope },
104
135
  },
105
- ctx.isIdle() ? { triggerTurn: true } : { deliverAs: "followUp" },
136
+ idle ? { triggerTurn: false } : { deliverAs: "followUp" },
137
+ );
138
+ if (
139
+ !normalizedFindings ||
140
+ normalizedFindings === "No actionable issues found."
141
+ )
142
+ return;
143
+ pi.sendUserMessage(
144
+ REVIEW_FINDINGS_FOLLOW_UP,
145
+ idle ? undefined : { deliverAs: "followUp" },
106
146
  );
107
147
  }
@@ -2,7 +2,12 @@ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
2
  import { resolveReviewConfig } from "./config.js";
3
3
  import { REVIEW_COMMAND } from "./constants.js";
4
4
  import { buildReviewConversationSummary } from "./conversation-summary.js";
5
- import { sendReviewFindings, sendReviewPreface } from "./messages.js";
5
+ import {
6
+ announceReviewFindingsReady,
7
+ announceReviewSummaryStarted,
8
+ sendReviewFindings,
9
+ sendReviewPreface,
10
+ } from "./messages.js";
6
11
  import { detectReviewContext } from "./review-context.js";
7
12
  import {
8
13
  appendReviewLoopBoundary,
@@ -135,6 +140,7 @@ export function registerReviewCommand(
135
140
  "warning",
136
141
  );
137
142
  setReviewWidget("Preparing review context…");
143
+ announceReviewSummaryStarted(pi);
138
144
  conversationSummary = await buildReviewConversationSummary(
139
145
  ctx,
140
146
  reviewConfig,
@@ -178,6 +184,7 @@ export function registerReviewCommand(
178
184
  );
179
185
 
180
186
  sendReviewFindings(pi, ctx, review, finalOutput);
187
+ announceReviewFindingsReady(pi);
181
188
  ctx.ui.notify(
182
189
  `Review findings sent back to the main agent from /${REVIEW_COMMAND}.`,
183
190
  "info",