@zephyrdeng/pi-review 0.12.0 → 0.13.0
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/README.md +19 -8
- package/README.zh-CN.md +13 -3
- package/dist/args.d.ts +12 -0
- package/dist/args.d.ts.map +1 -1
- package/dist/args.js +18 -5
- package/dist/args.js.map +1 -1
- package/dist/args.test.js +4 -2
- package/dist/args.test.js.map +1 -1
- package/dist/child-isolation.test.d.ts +2 -0
- package/dist/child-isolation.test.d.ts.map +1 -0
- package/dist/child-isolation.test.js +69 -0
- package/dist/child-isolation.test.js.map +1 -0
- package/dist/cli-exit.test.js +31 -0
- package/dist/cli-exit.test.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/meta-footer.d.ts.map +1 -1
- package/dist/meta-footer.js +11 -0
- package/dist/meta-footer.js.map +1 -1
- package/dist/meta-footer.test.js +31 -0
- package/dist/meta-footer.test.js.map +1 -1
- package/dist/panel-cli.test.js +34 -0
- package/dist/panel-cli.test.js.map +1 -1
- package/dist/panel.d.ts +13 -0
- package/dist/panel.d.ts.map +1 -1
- package/dist/panel.js +29 -11
- package/dist/panel.js.map +1 -1
- package/dist/review.d.ts +14 -0
- package/dist/review.d.ts.map +1 -1
- package/dist/review.js +31 -2
- package/dist/review.js.map +1 -1
- package/dist/skill-update.test.js +61 -3
- package/dist/skill-update.test.js.map +1 -1
- package/dist/skill.d.ts +28 -0
- package/dist/skill.d.ts.map +1 -1
- package/dist/skill.js +155 -31
- package/dist/skill.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/extensions/panel-tool.test.ts +15 -1
- package/extensions/panel-tool.ts +52 -20
- package/extensions/rv-completions.ts +1 -1
- package/extensions/rv-prompts.test.ts +13 -3
- package/extensions/rv-prompts.ts +28 -15
- package/package.json +1 -1
- package/skills/pi-review/SKILL.md +1 -1
- package/skills/pi-review/references/codex-tools.md +5 -5
- package/skills/pi-review/references/model-selection.md +1 -1
package/extensions/panel-tool.ts
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
formatTokens,
|
|
14
14
|
formatUsage,
|
|
15
15
|
reducePanelEvent,
|
|
16
|
+
resolveExclusivePanelShape,
|
|
16
17
|
spawnStreamingChild,
|
|
17
18
|
type PanelReviewMeta,
|
|
18
19
|
type PanelViewState,
|
|
@@ -147,15 +148,21 @@ function reviewerSummaryLines(state: PanelViewState): string[] {
|
|
|
147
148
|
* Full panel conclusion for the parent LLM and expanded TUI.
|
|
148
149
|
* Pure plain text / ASCII only — Pi does not render markdown in tool results.
|
|
149
150
|
*/
|
|
150
|
-
export function buildPanelResultContent(state: PanelViewState, error?: string): string {
|
|
151
|
+
export function buildPanelResultContent(state: PanelViewState, error?: string, note?: string): string {
|
|
151
152
|
const meta = state.meta;
|
|
152
|
-
if (!meta && !error)
|
|
153
|
-
|
|
153
|
+
if (!meta && !error) {
|
|
154
|
+
return note ? `${PANEL_TOOL_DISPLAY_NAME}: ${note}\n\nPanel completed: unknown` : "Panel completed: unknown";
|
|
155
|
+
}
|
|
156
|
+
if (!meta) {
|
|
157
|
+
const body = error ?? "Panel completed: unknown";
|
|
158
|
+
return note ? `${PANEL_TOOL_DISPLAY_NAME}: ${note}\n\n${body}` : body;
|
|
159
|
+
}
|
|
154
160
|
|
|
155
161
|
const findings = formatFindingsPlain(meta);
|
|
156
162
|
const ascii = formatPanelMetaAscii(meta);
|
|
157
163
|
const summaries = reviewerSummaryLines(state);
|
|
158
164
|
const parts = [
|
|
165
|
+
note ? `${PANEL_TOOL_DISPLAY_NAME}: ${note}` : "",
|
|
159
166
|
findings,
|
|
160
167
|
ascii,
|
|
161
168
|
summaries.length ? `Reviewer summaries:\n${summaries.join("\n")}` : "",
|
|
@@ -259,15 +266,35 @@ export type PanelToolParams = {
|
|
|
259
266
|
reviewers?: number;
|
|
260
267
|
};
|
|
261
268
|
|
|
262
|
-
|
|
263
|
-
|
|
269
|
+
export type NormalizedPanelToolParams = {
|
|
270
|
+
panel?: string;
|
|
271
|
+
reviewers?: number;
|
|
272
|
+
/** Set when both panel and reviewers were provided and reviewers was dropped. */
|
|
273
|
+
note?: string;
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Normalize agent tool args. Named presets own width/roles; if both `panel` and
|
|
278
|
+
* `reviewers` are set, prefer panel (common host habit) instead of hard-failing.
|
|
279
|
+
*/
|
|
280
|
+
export function normalizePanelToolParams(params: PanelToolParams): NormalizedPanelToolParams | { error: string } {
|
|
264
281
|
if (params.reviewers !== undefined) {
|
|
265
282
|
if (!Number.isSafeInteger(params.reviewers) || params.reviewers < 2 || params.reviewers > 8) {
|
|
266
|
-
return "reviewers must be an integer between 2 and 8; use the shell CLI for a single reviewer";
|
|
283
|
+
return { error: "reviewers must be an integer between 2 and 8; use the shell CLI for a single reviewer" };
|
|
267
284
|
}
|
|
268
|
-
if (params.panel) return "panel cannot be combined with reviewers";
|
|
269
285
|
}
|
|
270
|
-
|
|
286
|
+
const shape = resolveExclusivePanelShape(params);
|
|
287
|
+
const note =
|
|
288
|
+
shape.ignoredReviewers !== undefined
|
|
289
|
+
? `ignored reviewers=${shape.ignoredReviewers}; panel "${shape.panel}" defines the reviewer set`
|
|
290
|
+
: undefined;
|
|
291
|
+
return { panel: shape.panel, reviewers: shape.reviewers, ...(note ? { note } : {}) };
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/** Runtime guard for direct tool calls; schema validation is not the only boundary. */
|
|
295
|
+
export function panelToolParamError(params: PanelToolParams): string | undefined {
|
|
296
|
+
const normalized = normalizePanelToolParams(params);
|
|
297
|
+
return "error" in normalized ? normalized.error : undefined;
|
|
271
298
|
}
|
|
272
299
|
|
|
273
300
|
export function registerPanelReviewTool(pi: ExtensionAPI): void {
|
|
@@ -279,8 +306,8 @@ export function registerPanelReviewTool(pi: ExtensionAPI): void {
|
|
|
279
306
|
parameters: Type.Object({
|
|
280
307
|
target: Type.String({ description: "Review target as given by the user, such as @src, @src/foo.ts, or a free-text brief. Directories stay tool path targets; only real files are attached." }),
|
|
281
308
|
mode: Type.Optional(Type.String({ description: "Review mode; defaults to code." })),
|
|
282
|
-
panel: Type.Optional(Type.String({ description: "Named panel preset; defaults to code-experts when reviewers is omitted." })),
|
|
283
|
-
reviewers: Type.Optional(Type.Number({ minimum: 2, maximum: 8, description: "Independent reviewer count (2-8).
|
|
309
|
+
panel: Type.Optional(Type.String({ description: "Named panel preset; defaults to code-experts when reviewers is omitted. If both panel and reviewers are set, panel wins." })),
|
|
310
|
+
reviewers: Type.Optional(Type.Number({ minimum: 2, maximum: 8, description: "Independent reviewer count (2-8). Omit when panel is set (panel wins if both appear). Single review uses the shell CLI." })),
|
|
284
311
|
reviewerModels: Type.Optional(Type.Array(Type.String(), { description: "Per-reviewer models as id=provider/model[:thinking] (e.g. r1=openai/gpt-5.6-sol:low). Trailing :thinking wins over shared thinking." })),
|
|
285
312
|
consensus: Type.Optional(Type.String({ description: "any | quorum | majority | unanimous" })),
|
|
286
313
|
minAgree: Type.Optional(Type.Number({ description: "Quorum threshold when consensus=quorum" })),
|
|
@@ -317,26 +344,29 @@ export function registerPanelReviewTool(pi: ExtensionAPI): void {
|
|
|
317
344
|
const stdoutSink = new Writable({ write(chunk, _encoding, callback) { consume(String(chunk)); callback(); } });
|
|
318
345
|
const stderrSink = new Writable({
|
|
319
346
|
write(chunk, _encoding, callback) {
|
|
347
|
+
// Keep a larger tail so child crash stacks (issue #8) survive when the
|
|
348
|
+
// panel CLI itself fails before emitting a final event.
|
|
320
349
|
const next = stderr + String(chunk);
|
|
321
|
-
stderr = next.length >
|
|
350
|
+
stderr = next.length > 12_000 ? next.slice(-12_000) : next;
|
|
322
351
|
callback();
|
|
323
352
|
},
|
|
324
353
|
});
|
|
325
354
|
// Preserve the full panel configuration and enforce the panel-only tool boundary.
|
|
326
|
-
const
|
|
327
|
-
if (
|
|
355
|
+
const normalized = normalizePanelToolParams(params);
|
|
356
|
+
if ("error" in normalized) {
|
|
328
357
|
setAmbientStatus(toolCtx, undefined);
|
|
329
358
|
return {
|
|
330
|
-
content: [{ type: "text", text: `${PANEL_TOOL_DISPLAY_NAME}: ${
|
|
331
|
-
details: { state, error:
|
|
359
|
+
content: [{ type: "text", text: `${PANEL_TOOL_DISPLAY_NAME}: ${normalized.error}` }],
|
|
360
|
+
details: { state, error: normalized.error },
|
|
332
361
|
isError: true,
|
|
333
362
|
};
|
|
334
363
|
}
|
|
364
|
+
const shapeNote = normalized.note;
|
|
335
365
|
const args = [cliPath, "--mode", params.mode ?? "code", "--output-format", "events-jsonl"];
|
|
336
|
-
if (
|
|
337
|
-
args.push("--reviewers", String(
|
|
366
|
+
if (normalized.reviewers !== undefined) {
|
|
367
|
+
args.push("--reviewers", String(normalized.reviewers));
|
|
338
368
|
} else {
|
|
339
|
-
args.push("--panel",
|
|
369
|
+
args.push("--panel", normalized.panel ?? "code-experts");
|
|
340
370
|
}
|
|
341
371
|
for (const mapping of params.reviewerModels ?? []) args.push("--reviewer-model", mapping);
|
|
342
372
|
if (params.consensus) args.push("--consensus", params.consensus);
|
|
@@ -374,14 +404,16 @@ export function registerPanelReviewTool(pi: ExtensionAPI): void {
|
|
|
374
404
|
const details: PanelToolDetails = { state, ...(error ? { error } : {}) };
|
|
375
405
|
return {
|
|
376
406
|
// Parent LLM must receive the full conclusion; details remain the TUI rendering source.
|
|
377
|
-
content: [{ type: "text", text: buildPanelResultContent(state, error) }],
|
|
407
|
+
content: [{ type: "text", text: buildPanelResultContent(state, error, shapeNote) }],
|
|
378
408
|
details,
|
|
379
409
|
...(error ? { isError: true } : {}),
|
|
380
410
|
};
|
|
381
411
|
},
|
|
382
412
|
renderCall(args, theme, context) {
|
|
383
413
|
const text = context.lastComponent instanceof Text ? context.lastComponent : new Text("", 0, 0);
|
|
384
|
-
const
|
|
414
|
+
const shape = resolveExclusivePanelShape(args);
|
|
415
|
+
const width =
|
|
416
|
+
shape.reviewers !== undefined ? `reviewers=${shape.reviewers}` : (shape.panel ?? "code-experts");
|
|
385
417
|
text.setText(theme.fg("toolTitle", theme.bold(`${PANEL_TOOL_DISPLAY_NAME} `)) + theme.fg("muted", `${width} · ${args.mode ?? "code"} · ${args.target}`));
|
|
386
418
|
return text;
|
|
387
419
|
},
|
|
@@ -77,7 +77,7 @@ export const FLAG_HINTS: Record<string, string> = {
|
|
|
77
77
|
"--max-rounds": "Loop hard budget: how many review gates (not reviewer count)",
|
|
78
78
|
"--until": "Loop stop goal: clean",
|
|
79
79
|
"--reviewers": "Panel width: independent reviewers per gate (1-8)",
|
|
80
|
-
"--panel": "Named expert panel preset (
|
|
80
|
+
"--panel": "Named expert panel preset (if both set with --reviewers, --panel wins)",
|
|
81
81
|
"--reviewer-model": "Per-reviewer model: pick rK= then model (repeatable)",
|
|
82
82
|
"--consensus": "any | quorum | majority | unanimous",
|
|
83
83
|
"--min-agree": "Quorum threshold (quorum only)",
|
|
@@ -84,7 +84,8 @@ describe("parseRvArgs / validateRvParsed", () => {
|
|
|
84
84
|
assert.match(prompt, /natural-language review request/);
|
|
85
85
|
assert.match(prompt, /Do not expand directory targets into multi-file lists/);
|
|
86
86
|
assert.match(prompt, /panel="code-experts"/);
|
|
87
|
-
assert.match(prompt, /
|
|
87
|
+
assert.match(prompt, /Pass only one of panel or reviewers/);
|
|
88
|
+
assert.match(prompt, /panel wins/);
|
|
88
89
|
assert.match(prompt, /Slash commands select strategy only/);
|
|
89
90
|
assert.doesNotMatch(prompt, /@src\/panel\.ts|@src\/json-events\.ts/);
|
|
90
91
|
});
|
|
@@ -235,10 +236,19 @@ describe("parseRvArgs / validateRvParsed", () => {
|
|
|
235
236
|
]);
|
|
236
237
|
});
|
|
237
238
|
|
|
238
|
-
it("
|
|
239
|
+
it("panel + reviewers is accepted and builders prefer panel", () => {
|
|
239
240
|
const both = parseRvArgs("--reviewers 3 --panel code-experts @src", "loop");
|
|
240
|
-
assert.equal(validateRvParsed(both).ok,
|
|
241
|
+
assert.equal(validateRvParsed(both).ok, true);
|
|
242
|
+
const argv = buildPiReviewArgv(both, "@src");
|
|
243
|
+
assert.ok(argv.includes("--panel"));
|
|
244
|
+
assert.ok(argv.includes("code-experts"));
|
|
245
|
+
assert.ok(!argv.includes("--reviewers"));
|
|
246
|
+
const instruction = buildPiReviewToolCallInstruction(both, "@src");
|
|
247
|
+
assert.match(instruction, /panel="code-experts"/);
|
|
248
|
+
assert.doesNotMatch(instruction, /reviewers=3/);
|
|
249
|
+
});
|
|
241
250
|
|
|
251
|
+
it("rejects incompatible panel strategy combinations", () => {
|
|
242
252
|
const badConsensus = parseRvArgs("--reviewers 3 --consensus nope @src", "loop");
|
|
243
253
|
assert.equal(validateRvParsed(badConsensus).ok, false);
|
|
244
254
|
|
package/extensions/rv-prompts.ts
CHANGED
|
@@ -52,7 +52,7 @@ export type RvParsed = {
|
|
|
52
52
|
/** Panel width: independent reviewers for one gate (and each loop round). */
|
|
53
53
|
reviewers?: number;
|
|
54
54
|
reviewersError?: string;
|
|
55
|
-
/** Named panel preset (e.g. code-experts).
|
|
55
|
+
/** Named panel preset (e.g. code-experts). If both panel and reviewers are set, panel wins. */
|
|
56
56
|
panel?: string;
|
|
57
57
|
/** Per-reviewer model overrides: id=provider/model (repeatable). */
|
|
58
58
|
reviewerModels?: string[];
|
|
@@ -403,31 +403,31 @@ export function validateRvParsed(parsed: RvParsed): RvValidation {
|
|
|
403
403
|
if (parsed.until !== undefined && parsed.strategy !== "loop") {
|
|
404
404
|
return { ok: false, message: "--until is only valid with /rv-loop." };
|
|
405
405
|
}
|
|
406
|
-
|
|
407
|
-
return { ok: false, message: "--reviewers cannot be used with --panel" };
|
|
408
|
-
}
|
|
406
|
+
// panel + reviewers is allowed at parse time; builders prefer panel (see preferPanelShape).
|
|
409
407
|
if (parsed.reviewers !== undefined && (parsed.reviewers < 1 || parsed.reviewers > RV_MAX_REVIEWERS)) {
|
|
410
408
|
return { ok: false, message: `--reviewers must be between 1 and ${RV_MAX_REVIEWERS}` };
|
|
411
409
|
}
|
|
410
|
+
const shape = preferPanelShape(parsed);
|
|
412
411
|
const hasPanelOnlyOptions =
|
|
413
412
|
parsed.consensus !== undefined ||
|
|
414
413
|
parsed.minAgree !== undefined ||
|
|
415
414
|
parsed.consensusModel !== undefined ||
|
|
416
415
|
parsed.concurrency !== undefined ||
|
|
417
416
|
(parsed.reviewerModels?.length ?? 0) > 0;
|
|
418
|
-
if (
|
|
417
|
+
if (shape.reviewers === 1 && !shape.panel && hasPanelOnlyOptions) {
|
|
419
418
|
return { ok: false, message: "panel options require --reviewers > 1 or --panel" };
|
|
420
419
|
}
|
|
421
420
|
if (parsed.minAgree !== undefined) {
|
|
422
421
|
if (parsed.consensus && parsed.consensus !== "quorum") {
|
|
423
422
|
return { ok: false, message: "--min-agree is only valid with --consensus quorum" };
|
|
424
423
|
}
|
|
425
|
-
|
|
426
|
-
|
|
424
|
+
// Named panels resolve width later; only compare against explicit numeric width.
|
|
425
|
+
if (shape.reviewers !== undefined && parsed.minAgree > shape.reviewers) {
|
|
426
|
+
return { ok: false, message: `--min-agree ${parsed.minAgree} cannot exceed reviewers ${shape.reviewers}` };
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
|
-
if (parsed.concurrency !== undefined &&
|
|
430
|
-
return { ok: false, message: `--concurrency ${parsed.concurrency} cannot exceed reviewers ${
|
|
429
|
+
if (parsed.concurrency !== undefined && shape.reviewers !== undefined && parsed.concurrency > shape.reviewers) {
|
|
430
|
+
return { ok: false, message: `--concurrency ${parsed.concurrency} cannot exceed reviewers ${shape.reviewers}` };
|
|
431
431
|
}
|
|
432
432
|
for (const flag of FLAGS_REQUIRING_VALUE) {
|
|
433
433
|
if (parsed.target === flag) {
|
|
@@ -445,6 +445,17 @@ export function shellQuote(value: string): string {
|
|
|
445
445
|
return `'${value.replace(/'/g, `'"'"'`)}'`;
|
|
446
446
|
}
|
|
447
447
|
|
|
448
|
+
/** Prefer named panel over numeric width when both appear (matches CLI/tool soft-resolve). */
|
|
449
|
+
export function preferPanelShape(parsed: Pick<RvParsed, "panel" | "reviewers">): {
|
|
450
|
+
panel?: string;
|
|
451
|
+
reviewers?: number;
|
|
452
|
+
} {
|
|
453
|
+
if (parsed.panel !== undefined && parsed.reviewers !== undefined) {
|
|
454
|
+
return { panel: parsed.panel };
|
|
455
|
+
}
|
|
456
|
+
return { panel: parsed.panel, reviewers: parsed.reviewers };
|
|
457
|
+
}
|
|
458
|
+
|
|
448
459
|
/** Same optional flags for initial review and --continue follow-up (all optional). */
|
|
449
460
|
export function buildPiReviewArgv(parsed: RvParsed, target: string): string[] {
|
|
450
461
|
const parts = ["pi-review"];
|
|
@@ -470,8 +481,9 @@ export function buildPiReviewArgv(parsed: RvParsed, target: string): string[] {
|
|
|
470
481
|
if (parsed.model) parts.push("--model", parsed.model);
|
|
471
482
|
if (parsed.thinking) parts.push("--thinking", parsed.thinking);
|
|
472
483
|
if (parsed.noStream) parts.push("--no-stream");
|
|
473
|
-
|
|
474
|
-
if (
|
|
484
|
+
const shape = preferPanelShape(parsed);
|
|
485
|
+
if (shape.panel) parts.push("--panel", shape.panel);
|
|
486
|
+
if (shape.reviewers !== undefined) parts.push("--reviewers", String(shape.reviewers));
|
|
475
487
|
for (const mapping of parsed.reviewerModels ?? []) parts.push("--reviewer-model", mapping);
|
|
476
488
|
if (parsed.consensus) parts.push("--consensus", parsed.consensus);
|
|
477
489
|
if (parsed.minAgree !== undefined) parts.push("--min-agree", String(parsed.minAgree));
|
|
@@ -488,12 +500,13 @@ export function formatPiReviewCommandLine(parsed: RvParsed, target: string): str
|
|
|
488
500
|
|
|
489
501
|
/** Build the native pi_review tool call instruction without dropping panel config. */
|
|
490
502
|
export function buildPiReviewToolCallInstruction(parsed: RvParsed, target: string): string {
|
|
503
|
+
const shape = preferPanelShape(parsed);
|
|
491
504
|
const fields: string[] = [
|
|
492
505
|
`target=${JSON.stringify(target)}`,
|
|
493
506
|
`mode=${JSON.stringify(parsed.mode)}`,
|
|
494
507
|
];
|
|
495
|
-
if (
|
|
496
|
-
if (
|
|
508
|
+
if (shape.panel) fields.push(`panel=${JSON.stringify(shape.panel)}`);
|
|
509
|
+
if (shape.reviewers !== undefined) fields.push(`reviewers=${shape.reviewers}`);
|
|
497
510
|
if (parsed.reviewerModels?.length) fields.push(`reviewerModels=${JSON.stringify(parsed.reviewerModels)}`);
|
|
498
511
|
if (parsed.consensus) fields.push(`consensus=${JSON.stringify(parsed.consensus)}`);
|
|
499
512
|
if (parsed.minAgree !== undefined) fields.push(`minAgree=${parsed.minAgree}`);
|
|
@@ -502,10 +515,10 @@ export function buildPiReviewToolCallInstruction(parsed: RvParsed, target: strin
|
|
|
502
515
|
if (parsed.model) fields.push(`model=${JSON.stringify(parsed.model)}`);
|
|
503
516
|
if (parsed.thinking) fields.push(`thinking=${JSON.stringify(parsed.thinking)}`);
|
|
504
517
|
// Default panel when /rv has no explicit width/preset: keep code-experts.
|
|
505
|
-
if (parsed.strategy === "panel" && !
|
|
518
|
+
if (parsed.strategy === "panel" && !shape.panel && shape.reviewers === undefined) {
|
|
506
519
|
fields.push(`panel=${JSON.stringify("code-experts")}`);
|
|
507
520
|
}
|
|
508
|
-
return `Call pi_review with ${fields.join(", ")}. Treat target as a natural-language review request. Do not expand directory targets into multi-file lists.
|
|
521
|
+
return `Call pi_review with ${fields.join(", ")}. Treat target as a natural-language review request. Do not expand directory targets into multi-file lists. Pass only one of panel or reviewers (if both appear, panel wins). Keep reviewerModels/consensus/minAgree when provided.`;
|
|
509
522
|
}
|
|
510
523
|
|
|
511
524
|
export function orchestrationLocaleNote(locale: RvLocale = "en"): string {
|
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@ node ../../bin/pi-review.js --help
|
|
|
27
27
|
|------|-------------------------|
|
|
28
28
|
| **Pi** (`/rv`) | New panel reviews call the native `pi_review` API tool, shown to users as **Pi Review Panel**, which launches the packaged CLI in event mode and renders live reviewer state. Continuations, kept sessions, `/rv-loop`, and explicit `--no-stream` use the shell CLI. |
|
|
29
29
|
| **Pi terminal** | Foreground `pi-review`; text deltas stream live by default. |
|
|
30
|
-
| **Claude Code / Codex / Cursor** and similar agent hosts | These hosts buffer a shell tool's output until the command exits, so a foreground run looks like a silent wait. **Panel review (`--reviewers`/`--panel`) default: `--ui web --ui-url-file <path>` + background run** — get the dashboard in front of the user: on Claude Code the CLI auto-open lands in the system default browser; on Codex open the `--ui-url-file` URL in the host's built-in browser (the CLI cannot reach a GUI there); hand over the URL as fallback either way. **Single review / `loop` default: `--progress-log <path>` + background run + tail the log** (`--ui web` requires an active panel and rejects `loop`). See [references/codex-tools.md](./references/codex-tools.md). Map skill mentions of `Bash` to your host shell tool. |
|
|
30
|
+
| **Claude Code / Codex / Cursor / agy (Antigravity)** and similar agent hosts | These hosts buffer a shell tool's output until the command exits, so a foreground run looks like a silent wait. **Panel review (`--reviewers`/`--panel`) default: `--ui web --ui-url-file <path>` + background run** — get the dashboard in front of the user: on Claude Code the CLI auto-open lands in the system default browser; on Codex open the `--ui-url-file` URL in the host's built-in browser (the CLI cannot reach a GUI there); on agy prefer the host browser / share the URL the same way; hand over the URL as fallback either way. **Single review / `loop` default: `--progress-log <path>` + background run + tail the log** (`--ui web` requires an active panel and rejects `loop`). See [references/codex-tools.md](./references/codex-tools.md). Map skill mentions of `Bash` to your host shell tool. |
|
|
31
31
|
| Scripts / CI | Foreground is fine; add `--no-stream` only when the caller must buffer until exit (cannot combine with `--progress-log`). |
|
|
32
32
|
|
|
33
33
|
`--progress-log <path>` tees a compact `--mode json` event stream to a file for outside observation and debugging (each `message_update` reduces its cumulative message snapshots to `usage` to keep the file small; add `--progress-log-raw` for the verbatim stream); it is never a prerequisite for metrics. Token usage accumulates by default, and `pi-review` writes milestone notices (`pi-review: review started`, `pi-review: tool <name> started/finished`, `pi-review: review finished`) to stderr.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Agent host tool notes (Codex / Claude Code)
|
|
1
|
+
# Agent host tool notes (Codex / Claude Code / Cursor / agy)
|
|
2
2
|
|
|
3
|
-
Skills may use Claude Code tool names. On **Codex** or **
|
|
3
|
+
Skills may use Claude Code tool names. On **Codex**, **Claude Code**, **Cursor**, or **agy (Antigravity)**, map them to your native tools:
|
|
4
4
|
|
|
5
5
|
| Skill references | Typical host equivalent |
|
|
6
6
|
|-----------------|-------------------------|
|
|
@@ -10,13 +10,13 @@ Skills may use Claude Code tool names. On **Codex** or **Claude Code**, map them
|
|
|
10
10
|
|
|
11
11
|
This file is **pi-review–specific** and ships with the pi-review package.
|
|
12
12
|
|
|
13
|
-
## Long-running `pi-review` (default on Codex / Claude Code)
|
|
13
|
+
## Long-running `pi-review` (default on Codex / Claude Code / Cursor / agy)
|
|
14
14
|
|
|
15
15
|
Native shell tools on these hosts **buffer stdout/stderr until the command exits**. A multi-minute foreground `pi-review` run looks like a silent wait, then one large dump — never promise live foreground streaming. Which side channel to use depends on the run type: panel review gets the browser dashboard; single review and `loop` get the tailed progress log.
|
|
16
16
|
|
|
17
17
|
### Panel review: browser dashboard (default)
|
|
18
18
|
|
|
19
|
-
`--reviewers <n>` or `--panel <name>` activates panel review. On Codex, Claude Code, or
|
|
19
|
+
`--reviewers <n>` or `--panel <name>` activates panel review. On Codex, Claude Code, Cursor, or agy, default to the dashboard instead of a tailed log:
|
|
20
20
|
|
|
21
21
|
1. Run `pi-review --reviewers <n> --ui web --ui-url-file <path> -- <target>` (or `--panel <name>`) in the **background**. Pass `--no-ui-open` only when the user asked not to open a browser (CI, remote shells).
|
|
22
22
|
2. Read `<path>` shortly after launch — it is written atomically as soon as the dashboard server is ready, well before reviewers finish (poll a few times a second for a couple of seconds if the file is not there yet). Then get the dashboard in front of the user: on **Claude Code** the CLI auto-open already lands in the system default browser; on **Codex** the CLI cannot reach a GUI browser, so open the URL from `<path>` in the host's built-in browser yourself. Share the URL either way as a fallback: *"Dashboard opened in your browser (URL: `<url>`). I'll report back when the review completes."*
|
|
@@ -32,7 +32,7 @@ Native shell tools on these hosts **buffer stdout/stderr until the command exits
|
|
|
32
32
|
|
|
33
33
|
**Pi interactive (`/rv`)**: foreground `pi-review`, default streaming. Text deltas appear live on the terminal; no `--progress-log`/`--ui web` unless the user asked — Pi already renders panel progress natively.
|
|
34
34
|
|
|
35
|
-
See the parent skill
|
|
35
|
+
See the parent skill section *Default workflow by host* (Claude Code / Codex / Cursor / agy row).
|
|
36
36
|
|
|
37
37
|
### Loop closeout
|
|
38
38
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Use this after `pi-review models` (or `pi-review models <search>`). **Never invent** `provider/model` IDs—only IDs that appear in that output.
|
|
4
4
|
|
|
5
|
-
## Workflow (Claude Code, Codex, Cursor, Pi parent agent)
|
|
5
|
+
## Workflow (Claude Code, Codex, Cursor, agy, Pi parent agent)
|
|
6
6
|
|
|
7
7
|
1. Run `pi-review models` (narrow with search if the user named a vendor or model family).
|
|
8
8
|
2. Infer **review profile** from the target (see table below).
|