@howaboua/pi-subagent-review 0.1.2 → 0.1.4
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 +4 -4
- package/index.ts +1 -1
- package/package.json +14 -2
- package/src/config.ts +1 -1
- package/src/constants.ts +2 -2
- package/src/review-command.ts +1 -1
- package/src/review.ts +2 -2
- package/src/subagent.ts +1 -1
- package/src/types.ts +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
- `/review`
|
|
6
6
|
|
|
7
|
-
It runs an isolated review subagent against your current repo, injects the findings back into the session as a user message, and the main agent
|
|
7
|
+
It runs an isolated review subagent against your current repo, injects the findings back into the session as a user message, and asks the main agent to consider those findings in light of the prior conversation before deciding what to address. It is modelled after Codex CLI's /review command.
|
|
8
8
|
|
|
9
9
|
## What it does
|
|
10
10
|
|
|
@@ -15,7 +15,7 @@ It runs an isolated review subagent against your current repo, injects the findi
|
|
|
15
15
|
- inspects committed and dirty worktree changes
|
|
16
16
|
- runs an isolated review subagent
|
|
17
17
|
- sends the findings back into the current Pi session as a user message
|
|
18
|
-
- as a result, the main agent
|
|
18
|
+
- as a result, the main agent reviews the findings against the prior conversation and addresses only clearly worthwhile issues
|
|
19
19
|
|
|
20
20
|
## Automatic base branch selection
|
|
21
21
|
|
|
@@ -52,8 +52,8 @@ Edit that file to change the default review model or thinking level:
|
|
|
52
52
|
|
|
53
53
|
```json
|
|
54
54
|
{
|
|
55
|
-
"model": "openai-codex/gpt-5.
|
|
56
|
-
"thinking": "
|
|
55
|
+
"model": "openai-codex/gpt-5.5",
|
|
56
|
+
"thinking": "medium"
|
|
57
57
|
}
|
|
58
58
|
```
|
|
59
59
|
|
package/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExtensionAPI } from "@
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { ensureConfigFile } from "./src/config.js";
|
|
3
3
|
import { CHILD_ENV } from "./src/constants.js";
|
|
4
4
|
import { registerReviewCommand } from "./src/review-command.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@howaboua/pi-subagent-review",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Pi extension that adds /review via an isolated review subagent.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -32,6 +32,18 @@
|
|
|
32
32
|
]
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@
|
|
35
|
+
"@earendil-works/pi-ai": "*",
|
|
36
|
+
"@earendil-works/pi-coding-agent": "*"
|
|
37
|
+
},
|
|
38
|
+
"type": "module",
|
|
39
|
+
"scripts": {
|
|
40
|
+
"check": "tsc --noEmit",
|
|
41
|
+
"prepack": "npm run check"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@earendil-works/pi-ai": "^0.74.1",
|
|
45
|
+
"@earendil-works/pi-coding-agent": "^0.74.1",
|
|
46
|
+
"@types/node": "^24.10.0",
|
|
47
|
+
"typescript": "^5.9.3"
|
|
36
48
|
}
|
|
37
49
|
}
|
package/src/config.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
|
-
import type { ExtensionAPI, ExtensionCommandContext } from "@
|
|
2
|
+
import type { ExtensionAPI, ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
3
3
|
import { ALLOWED_THINKING, DEFAULT_CONFIG, REVIEW_COMMAND, getAgentDir, getConfigPath } from "./constants.js";
|
|
4
4
|
import type { ChildRunDetails, ReviewConfig, ThinkingLevel, UsageStats } from "./types.js";
|
|
5
5
|
|
package/src/constants.ts
CHANGED
|
@@ -11,8 +11,8 @@ export const CONFIG_FILENAME = "pi-subagent-review.json";
|
|
|
11
11
|
export const REVIEW_PROMPT_PATH = path.join(path.resolve(__dirname, ".."), "review.prompt.md");
|
|
12
12
|
|
|
13
13
|
export const DEFAULT_CONFIG = {
|
|
14
|
-
model: "openai-codex/gpt-5.
|
|
15
|
-
thinking: "
|
|
14
|
+
model: "openai-codex/gpt-5.5",
|
|
15
|
+
thinking: "medium",
|
|
16
16
|
} as const;
|
|
17
17
|
|
|
18
18
|
export const ALLOWED_THINKING = new Set(["off", "minimal", "low", "medium", "high", "xhigh"] as const);
|
package/src/review-command.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExtensionAPI } from "@
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { REVIEW_COMMAND } from "./constants.js";
|
|
3
3
|
import { createChildRunDetails, isSubagentFailure, resolveReviewConfig } from "./config.js";
|
|
4
4
|
import { buildReviewTask, buildReviewUserMessage, detectReviewContext } from "./review.js";
|
package/src/review.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExtensionAPI } from "@
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { REVIEW_COMMAND } from "./constants.js";
|
|
3
3
|
import type { ReviewContext } from "./types.js";
|
|
4
4
|
|
|
@@ -140,6 +140,6 @@ export function buildReviewUserMessage(review: ReviewContext, findings: string):
|
|
|
140
140
|
"",
|
|
141
141
|
findings.trim() || "No actionable issues found.",
|
|
142
142
|
"",
|
|
143
|
-
"
|
|
143
|
+
"Review the findings above in light of the prior conversation. Some choices may reflect intentional decisions the review subagent could not see; address only clearly worthwhile issues, and ask before changing context-dependent, low-impact, or diminishing-return items.",
|
|
144
144
|
].join("\n");
|
|
145
145
|
}
|
package/src/subagent.ts
CHANGED
|
@@ -79,7 +79,7 @@ export async function runReviewSubagent(task: string, cwd: string, config: Requi
|
|
|
79
79
|
reject(new Error(`Timed out waiting for RPC response to ${String(command.type)}.${details.stderr ? ` Stderr: ${details.stderr.trim()}` : ""}`));
|
|
80
80
|
}, timeoutMs);
|
|
81
81
|
|
|
82
|
-
pendingRequests.set(id, { resolve, reject, timeout });
|
|
82
|
+
pendingRequests.set(id, { resolve: (value) => resolve(value as T), reject, timeout });
|
|
83
83
|
proc.stdin.write(payload, (error) => {
|
|
84
84
|
if (!error) return;
|
|
85
85
|
clearTimeout(timeout);
|
package/src/types.ts
CHANGED