@bacnh85/pi-subagent 0.15.0 → 0.15.1
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 +7 -0
- package/README.md +1 -1
- package/agents/planner.md +1 -1
- package/agents/reviewer.md +1 -1
- package/extensions/index.ts +13 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.15.1 (2026-08-17)
|
|
4
|
+
|
|
5
|
+
### Improvements
|
|
6
|
+
|
|
7
|
+
- Project-local agent approval is now a single select — **Allow once / Trust for this session / Deny** — instead of a yes/no confirm repeated on every delegation. "Trust for this session" remembers the project agents dir for the session (cleared on `session_start`); dismissed dialogs and Deny cancel the delegation. Headless sessions still fail closed.
|
|
8
|
+
- New test coverage for the approval gate (Deny / dismissed / headless / trust-remembering / session_start clearing).
|
|
9
|
+
|
|
3
10
|
## 0.15.0 (2026-08-09)
|
|
4
11
|
|
|
5
12
|
### Packaging
|
package/README.md
CHANGED
|
@@ -91,7 +91,7 @@ Threads are session-memory only and are cleared when Pi replaces or reloads the
|
|
|
91
91
|
Agent files under `.pi/agents/` are controlled by the current repository. A project agent's system prompt may instruct a child to execute shell commands or modify files.
|
|
92
92
|
|
|
93
93
|
- **Project-agent approval cannot be disabled by the model.** The `confirmProjectAgents` parameter is not exposed in the tool schema. Confirmation policy comes from trusted user configuration only.
|
|
94
|
-
- **Interactive sessions** prompt the user before executing project agents.
|
|
94
|
+
- **Interactive sessions** prompt the user before executing project agents (**Allow once / Trust for this session / Deny**); "Trust for this session" remembers the project agents dir until the session ends. Dismissed dialogs and Deny cancel the delegation.
|
|
95
95
|
- **Headless sessions fail closed.** Project agents are not executed without UI confirmation unless the trusted setting `allowUnconfirmedProjectAgents` is enabled (via `PI_SUBAGENT_ALLOW_UNCONFIRMED_PROJECT_AGENTS=true` environment variable or pi settings).
|
|
96
96
|
- **The extension service path** (`pi-subagent:run` event) follows the same policy.
|
|
97
97
|
|
package/agents/planner.md
CHANGED
|
@@ -3,7 +3,7 @@ name: planner
|
|
|
3
3
|
description: Read-only planning and architecture specialist. Use for consequential design, tradeoff analysis, and implementation plans.
|
|
4
4
|
tools: read, grep, find, ls
|
|
5
5
|
models:
|
|
6
|
-
- zai-coding-cn/glm-5.
|
|
6
|
+
- zai-coding-cn/glm-5.3
|
|
7
7
|
- openrouter/nvidia/nemotron-3-ultra-550b-a55b:free
|
|
8
8
|
- opencode-go/deepseek-v4-pro
|
|
9
9
|
thinking: high
|
package/agents/reviewer.md
CHANGED
|
@@ -3,7 +3,7 @@ name: reviewer
|
|
|
3
3
|
description: Code review specialist. Use for correctness, security, regression, and meaningful test-gap review.
|
|
4
4
|
tools: read, grep, find, ls
|
|
5
5
|
models:
|
|
6
|
-
- zai-coding-cn/glm-5.
|
|
6
|
+
- zai-coding-cn/glm-5.3
|
|
7
7
|
- openrouter/nvidia/nemotron-3-ultra-550b-a55b:free
|
|
8
8
|
- opencode-go/deepseek-v4-pro
|
|
9
9
|
thinking: high
|
package/extensions/index.ts
CHANGED
|
@@ -95,6 +95,9 @@ function getTrustedConfig(ctx: ExtensionContext): { allowUnconfirmedProjectAgent
|
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
/** Session-scoped approvals for project-local agents ("Trust for this session"). */
|
|
99
|
+
const trustedProjectAgentDirs = new Set<string>();
|
|
100
|
+
|
|
98
101
|
|
|
99
102
|
// ---------------------------------------------------------------------------
|
|
100
103
|
// Tool parameter schema
|
|
@@ -186,6 +189,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
186
189
|
currentCtx = ctx;
|
|
187
190
|
if (event.reason === "reload") invalidateAgentCache();
|
|
188
191
|
threadStore.clear();
|
|
192
|
+
trustedProjectAgentDirs.clear();
|
|
189
193
|
// Clear any widget from a prior session.
|
|
190
194
|
widget.clearWidgetIfIdle();
|
|
191
195
|
// Mark prior-session running tasks as interrupted (we can't resume them).
|
|
@@ -591,19 +595,22 @@ export default function (pi: ExtensionAPI) {
|
|
|
591
595
|
|
|
592
596
|
if (projectAgentsRequested.length > 0) {
|
|
593
597
|
if (confirmProjectAgents) {
|
|
594
|
-
|
|
598
|
+
const dir = discovery.projectAgentsDir ?? "(unknown)";
|
|
599
|
+
if (trustedProjectAgentDirs.has(dir)) {
|
|
600
|
+
// Previously approved "Trust for this session" for this agents dir.
|
|
601
|
+
} else if (ctx.hasUI) {
|
|
595
602
|
const names = projectAgentsRequested.map((a) => a.name).join(", ");
|
|
596
|
-
const
|
|
597
|
-
|
|
598
|
-
"
|
|
599
|
-
`Agents: ${names}\nSource: ${dir}\n\nProject agents are repo-controlled. Only continue for trusted repositories.`,
|
|
603
|
+
const choice = await ctx.ui.select(
|
|
604
|
+
`Run project-local agents?\n\nAgents: ${names}\nSource: ${dir}\n\nProject agents are repo-controlled. Only continue for trusted repositories.`,
|
|
605
|
+
["Allow once", "Trust for this session", "Deny"],
|
|
600
606
|
);
|
|
601
|
-
if (
|
|
607
|
+
if (choice !== "Allow once" && choice !== "Trust for this session") {
|
|
602
608
|
return {
|
|
603
609
|
content: [{ type: "text", text: "Canceled: project-local agents not approved." }],
|
|
604
610
|
details: makeDetails(hasChain ? "chain" : hasTasks ? "parallel" : "single")([]),
|
|
605
611
|
};
|
|
606
612
|
}
|
|
613
|
+
if (choice === "Trust for this session") trustedProjectAgentDirs.add(dir);
|
|
607
614
|
} else {
|
|
608
615
|
// Fail closed in headless sessions.
|
|
609
616
|
return {
|
package/package.json
CHANGED