@howaboua/pi-subagent-review 0.2.22 → 0.2.25
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 +26 -0
- package/README.md +8 -4
- package/package.json +6 -6
- package/review.prompt.md +3 -8
- package/src/constants.ts +2 -2
- package/src/conversation-summary.ts +14 -7
- package/src/messages.ts +8 -4
- package/src/review-task.ts +3 -19
- package/src/subagent.ts +1 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @howaboua/pi-subagent-review
|
|
2
2
|
|
|
3
|
+
## 0.2.25
|
|
4
|
+
|
|
5
|
+
- Reviewer prompts now request evidence-backed findings without issue-count targets.
|
|
6
|
+
|
|
7
|
+
## 0.2.24
|
|
8
|
+
|
|
9
|
+
- GPT-6 Sol and Luna now share Astra's Codex support.
|
|
10
|
+
|
|
11
|
+
- Removed `/terra`; use `/luna` instead.
|
|
12
|
+
- Added Responses Lite, non-destructive reasoning changes and terse context guidance for GPT-6 Sol and Luna.
|
|
13
|
+
- Image descriptions now use GPT-6 Luna directly instead of preferring older mini models.
|
|
14
|
+
- Cost estimates now use published GPT-6 Sol and Luna rates, including cache writes and long-context pricing.
|
|
15
|
+
- Agent, review, exploration, web search, voice summary and image-description defaults now use GPT-6; Luna replaces Terra defaults. GPT Switcher retains Luna's 472K context limit, while Codex Conversion defaults all three GPT-6 models to 272K.
|
|
16
|
+
|
|
17
|
+
## 0.2.23
|
|
18
|
+
|
|
19
|
+
- Adapt Codex, Imagegen, review, and GipPity to Pi 0.87.
|
|
20
|
+
|
|
21
|
+
Codex Conversion, Imagegen, and Subagent Review require Pi 0.87.0 or newer.
|
|
22
|
+
|
|
23
|
+
- Fixed Codex prompt and tool updates rewriting the cached conversation prefix.
|
|
24
|
+
- Context reminders no longer start an extra checkpoint turn if the current run already saved a note in the current window.
|
|
25
|
+
- Fixed Imagegen recent-image selection ignoring context removals and replacements.
|
|
26
|
+
- Fixed review summaries and preface tracking ignoring context removals and replacements.
|
|
27
|
+
- Kept GipPity browser turn notifications from including full context previews and losing their fields to truncation.
|
|
28
|
+
|
|
3
29
|
## 0.2.22
|
|
4
30
|
|
|
5
31
|
- Removed redundant developer-message wording while preserving review approval rules and nested AGENTS.md guidance.
|
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@ Adds `/review`, which sends the current repository state to an isolated review s
|
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
|
+
Requires Pi 0.87.0 or newer.
|
|
8
|
+
|
|
7
9
|
```bash
|
|
8
10
|
pi install npm:@howaboua/pi-subagent-review
|
|
9
11
|
```
|
|
@@ -22,9 +24,11 @@ Run `/reload` after installation if Pi is already open.
|
|
|
22
24
|
|
|
23
25
|
Anything after `/review` becomes additional reviewer guidance. A leading `loop` starts review-loop mode and is removed from that guidance. In a JJ workspace, `stack=<ancestor revset>` selects a cumulative review base and is removed from that guidance; quote a revset containing spaces. Only one `stack=` argument is accepted.
|
|
24
26
|
|
|
25
|
-
Findings are advisory. The command tells the main agent to verify and categorize them against the current implementation and session context
|
|
27
|
+
Findings are advisory. The command tells the main agent to verify and categorize them against the current implementation and session context, then get your disposition before making changes.
|
|
28
|
+
|
|
29
|
+
`/review` waits for current agent work to finish, runs the reviewer, then sends its findings back to the main agent.
|
|
26
30
|
|
|
27
|
-
With a compatible optional Pi Codex Responses adapter, the review preface
|
|
31
|
+
With a compatible optional Pi Codex Responses adapter, the review preface uses developer-role policy. Raw findings and triage instructions remain lower-authority messages. Idle delivery starts a normal user-message turn.
|
|
28
32
|
|
|
29
33
|
## Review scope
|
|
30
34
|
|
|
@@ -44,11 +48,11 @@ On first load, the extension creates `~/.pi/agent/pi-subagent-review.json`, or t
|
|
|
44
48
|
|
|
45
49
|
```json
|
|
46
50
|
{
|
|
47
|
-
"model": "openai-codex/gpt-
|
|
51
|
+
"model": "openai-codex/gpt-6-sol",
|
|
48
52
|
"thinking": "medium",
|
|
49
53
|
"summary": {
|
|
50
54
|
"enabled": true,
|
|
51
|
-
"model": "openai-codex/gpt-
|
|
55
|
+
"model": "openai-codex/gpt-6-luna",
|
|
52
56
|
"thinking": "low"
|
|
53
57
|
}
|
|
54
58
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@howaboua/pi-subagent-review",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.25",
|
|
4
4
|
"description": "Pi extension that adds /review via an isolated review subagent.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
]
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@howaboua/pi-codex-conversion": ">=3.0.
|
|
43
|
+
"@howaboua/pi-codex-conversion": ">=3.0.40",
|
|
44
44
|
"@earendil-works/pi-ai": ">=0.84.3",
|
|
45
|
-
"@earendil-works/pi-coding-agent": ">=0.
|
|
45
|
+
"@earendil-works/pi-coding-agent": ">=0.87.0",
|
|
46
46
|
"@earendil-works/pi-tui": ">=0.84.3"
|
|
47
47
|
},
|
|
48
48
|
"peerDependenciesMeta": {
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"format": "biome check --write ."
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@howaboua/pi-codex-conversion": "3.0.
|
|
63
|
-
"@earendil-works/pi-ai": "0.
|
|
64
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
62
|
+
"@howaboua/pi-codex-conversion": "3.0.40",
|
|
63
|
+
"@earendil-works/pi-ai": "0.99.1",
|
|
64
|
+
"@earendil-works/pi-coding-agent": "0.99.1",
|
|
65
65
|
"@types/node": "^26.2.0",
|
|
66
66
|
"typescript": "^7.0.2",
|
|
67
67
|
"@biomejs/biome": "^2.5.10"
|
package/review.prompt.md
CHANGED
|
@@ -1,24 +1,19 @@
|
|
|
1
|
-
You are the Review Subagent,
|
|
1
|
+
You are the Review Subagent, a code-review specialist.
|
|
2
2
|
|
|
3
3
|
Rules:
|
|
4
4
|
- Stay strictly in review mode.
|
|
5
5
|
- You do not inherit the parent agent's prior conversation, plan, or hidden context. Treat the provided task as the entire brief.
|
|
6
|
-
- Do not edit files.
|
|
6
|
+
- Do not edit files or propose implementation plans beyond concise fixes.
|
|
7
7
|
- You are the subagent: do not spawn other subagents; perform the reviewer duties yourself.
|
|
8
8
|
- Use the selected VCS commands from the task, targeted file reads, and concrete evidence over assumptions.
|
|
9
|
-
-
|
|
9
|
+
- Review the full requested scope; report only concrete, actionable findings, including lower-severity issues.
|
|
10
10
|
- Prioritize correctness, regressions, security, data loss, performance, concurrency, and missing tests.
|
|
11
|
-
- Be slightly lenient: include lower-severity but still concrete, actionable issues when they are supported by evidence.
|
|
12
|
-
- Do not stop after finding only one or two issues; keep looking for additional credible findings.
|
|
13
|
-
- Aim to surface roughly 10-20 issues if the diff supports that many, but never pad or invent findings.
|
|
14
11
|
- Reference specific file paths and line ranges when possible.
|
|
15
12
|
- Suggest the smallest credible fix when helpful.
|
|
16
|
-
- If there are no actionable issues worth flagging, say that clearly.
|
|
17
13
|
|
|
18
14
|
Output format:
|
|
19
15
|
# Review Findings
|
|
20
16
|
- `[high|medium|low] path/to/file:start-end` - issue, why it matters, and the concrete fix
|
|
21
|
-
- ...continue with as many issue bullets as are warranted by the evidence
|
|
22
17
|
|
|
23
18
|
If there are no actionable issues, output exactly:
|
|
24
19
|
|
package/src/constants.ts
CHANGED
|
@@ -16,11 +16,11 @@ export const REVIEW_PROMPT_PATH = path.join(
|
|
|
16
16
|
);
|
|
17
17
|
|
|
18
18
|
export const DEFAULT_CONFIG = {
|
|
19
|
-
model: "openai-codex/gpt-
|
|
19
|
+
model: "openai-codex/gpt-6-sol",
|
|
20
20
|
thinking: "medium",
|
|
21
21
|
summary: {
|
|
22
22
|
enabled: true,
|
|
23
|
-
model: "openai-codex/gpt-
|
|
23
|
+
model: "openai-codex/gpt-6-luna",
|
|
24
24
|
thinking: "low",
|
|
25
25
|
},
|
|
26
26
|
} as const;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
ExtensionCommandContext,
|
|
3
|
-
|
|
3
|
+
ProjectedSessionEntry,
|
|
4
4
|
} from "@earendil-works/pi-coding-agent";
|
|
5
5
|
import { completeSummary } from "./summary-session.js";
|
|
6
6
|
import type { ResolvedReviewConfig } from "./types.js";
|
|
@@ -23,20 +23,27 @@ function textFromContent(content: unknown): string {
|
|
|
23
23
|
.join("\n");
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
function serializeEntry(
|
|
26
|
+
function serializeEntry({
|
|
27
|
+
sourceEntry: entry,
|
|
28
|
+
messages,
|
|
29
|
+
}: ProjectedSessionEntry): string | undefined {
|
|
27
30
|
switch (entry.type) {
|
|
28
31
|
case "message": {
|
|
29
|
-
const message =
|
|
32
|
+
const message = messages[0];
|
|
33
|
+
if (!message || !("content" in message)) return undefined;
|
|
30
34
|
const text = textFromContent(message.content).trim();
|
|
31
35
|
if (!text) return undefined;
|
|
32
|
-
return `## ${message.role
|
|
36
|
+
return `## ${message.role} (${entry.timestamp})\n${text}`;
|
|
33
37
|
}
|
|
34
38
|
case "branch_summary":
|
|
35
39
|
return `## branch summary (${entry.timestamp})\n${entry.summary}`;
|
|
36
40
|
case "compaction":
|
|
41
|
+
if (messages.length === 0) return undefined;
|
|
37
42
|
return `## compaction summary (${entry.timestamp})\n${entry.summary}`;
|
|
38
43
|
case "custom_message": {
|
|
39
|
-
const
|
|
44
|
+
const message = messages[0];
|
|
45
|
+
if (message?.role !== "custom") return undefined;
|
|
46
|
+
const text = textFromContent(message.content).trim();
|
|
40
47
|
if (!text) return undefined;
|
|
41
48
|
return `## custom message: ${entry.customType} (${entry.timestamp})\n${text}`;
|
|
42
49
|
}
|
|
@@ -49,7 +56,7 @@ function serializeEntry(entry: SessionEntry): string | undefined {
|
|
|
49
56
|
}
|
|
50
57
|
}
|
|
51
58
|
|
|
52
|
-
function buildSummaryInput(entries:
|
|
59
|
+
function buildSummaryInput(entries: ProjectedSessionEntry[]): string {
|
|
53
60
|
return entries
|
|
54
61
|
.map(serializeEntry)
|
|
55
62
|
.filter((value): value is string => Boolean(value))
|
|
@@ -107,7 +114,7 @@ export async function buildReviewConversationSummary(
|
|
|
107
114
|
if (!config.summary.enabled) return undefined;
|
|
108
115
|
|
|
109
116
|
const conversation = buildSummaryInput(
|
|
110
|
-
ctx.sessionManager.
|
|
117
|
+
ctx.sessionManager.buildSessionProjection().entries,
|
|
111
118
|
);
|
|
112
119
|
if (!conversation.trim()) return undefined;
|
|
113
120
|
|
package/src/messages.ts
CHANGED
|
@@ -63,12 +63,16 @@ function getReviewPrefaceMessageId(
|
|
|
63
63
|
ctx: ExtensionCommandContext,
|
|
64
64
|
): string | undefined {
|
|
65
65
|
let messageId: string | undefined;
|
|
66
|
-
for (const
|
|
66
|
+
for (const {
|
|
67
|
+
sourceEntry,
|
|
68
|
+
messages,
|
|
69
|
+
} of ctx.sessionManager.buildSessionProjection().entries) {
|
|
67
70
|
if (
|
|
68
|
-
|
|
69
|
-
|
|
71
|
+
sourceEntry.type === "custom_message" &&
|
|
72
|
+
sourceEntry.customType === REVIEW_PREFACE_MESSAGE_TYPE &&
|
|
73
|
+
messages.length > 0
|
|
70
74
|
) {
|
|
71
|
-
messageId =
|
|
75
|
+
messageId = sourceEntry.id;
|
|
72
76
|
}
|
|
73
77
|
}
|
|
74
78
|
return messageId;
|
package/src/review-task.ts
CHANGED
|
@@ -70,9 +70,7 @@ export function buildReviewTask(
|
|
|
70
70
|
"Required inspection steps:",
|
|
71
71
|
`1. Run \`git diff --stat ${review.mergeBase}\``,
|
|
72
72
|
`2. Run \`git diff ${review.mergeBase}\``,
|
|
73
|
-
|
|
74
|
-
`4. Run \`git diff ${review.baseBranch}...HEAD\``,
|
|
75
|
-
"5. Use targeted file diffs or reads where needed.",
|
|
73
|
+
"3. Use targeted file diffs or reads where needed.",
|
|
76
74
|
);
|
|
77
75
|
} else {
|
|
78
76
|
sections.push(
|
|
@@ -86,27 +84,13 @@ export function buildReviewTask(
|
|
|
86
84
|
);
|
|
87
85
|
}
|
|
88
86
|
|
|
89
|
-
if (review.status) {
|
|
87
|
+
if (review.status && review.baseBranch && review.mergeBase) {
|
|
90
88
|
sections.push(
|
|
91
89
|
"",
|
|
92
|
-
"
|
|
93
|
-
"- `git diff --cached`",
|
|
94
|
-
"- `git diff`",
|
|
95
|
-
"- any relevant untracked files reported by status",
|
|
90
|
+
"Inspect relevant untracked files reported by status. Use staged or unstaged diffs only to answer questions not covered by the checkout comparison.",
|
|
96
91
|
);
|
|
97
92
|
}
|
|
98
93
|
|
|
99
|
-
sections.push(
|
|
100
|
-
"",
|
|
101
|
-
"Return prioritized, actionable findings only.",
|
|
102
|
-
"Be slightly lenient: include lower-severity but still concrete, actionable issues when supported by evidence.",
|
|
103
|
-
"Do not stop after finding only one or two issues; keep looking for additional credible findings.",
|
|
104
|
-
"Aim for roughly 10-20 issues if the diff supports that many, but do not pad or invent findings.",
|
|
105
|
-
"Focus on correctness, regressions, security, data loss, performance, concurrency, and missing tests.",
|
|
106
|
-
"Reference specific files and line ranges when possible.",
|
|
107
|
-
"If there are no actionable issues worth flagging, say that clearly.",
|
|
108
|
-
);
|
|
109
|
-
|
|
110
94
|
if (extraFocus.trim()) {
|
|
111
95
|
sections.push("", `Additional user focus: ${extraFocus.trim()}`);
|
|
112
96
|
}
|
package/src/subagent.ts
CHANGED
|
@@ -44,13 +44,6 @@ export async function runReviewSubagent(
|
|
|
44
44
|
REVIEW_PROMPT_PATH,
|
|
45
45
|
],
|
|
46
46
|
});
|
|
47
|
-
const prompt = [
|
|
48
|
-
"Run as the Review Subagent inside an isolated no-session RPC subprocess.",
|
|
49
|
-
"Stay strictly in review mode. Do not edit files or propose implementation plans beyond concise fixes.",
|
|
50
|
-
"Do not stop after one or two findings; keep looking for additional credible issues, aiming for roughly 10-20 if warranted.",
|
|
51
|
-
"Mode: review",
|
|
52
|
-
`Task: ${task}`,
|
|
53
|
-
].join("\n\n");
|
|
54
47
|
const abort = () => {
|
|
55
48
|
void client.abort().catch(() => undefined);
|
|
56
49
|
};
|
|
@@ -64,7 +57,7 @@ export async function runReviewSubagent(
|
|
|
64
57
|
await client.setAutoRetry(true);
|
|
65
58
|
if (signal?.aborted) throw new Error(`${REVIEW_LABEL} aborted.`);
|
|
66
59
|
const events = await client.promptAndWait(
|
|
67
|
-
|
|
60
|
+
`Task: ${task}`,
|
|
68
61
|
undefined,
|
|
69
62
|
REVIEW_TIMEOUT_MS,
|
|
70
63
|
);
|