pi-open-agents 0.1.3 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.ts +13 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-open-agents",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Unified agent and subagent management for pi coding agent, with OpenCode-compatible agent definitions.",
5
5
  "keywords": [
6
6
  "pi-package",
package/src/index.ts CHANGED
@@ -26,7 +26,7 @@ import { updateBanner } from "./tui/banner.ts";
26
26
  import { registerTuiControls } from "./tui/selector.ts";
27
27
  import { registerAgentTools } from "./tui/tools.ts";
28
28
  import { registerSubagentTool } from "./subagent/tool.ts";
29
- import { allowedAgentNames } from "./subagent/env.ts";
29
+ import { allowedAgentNames, isSubagentProcess } from "./subagent/env.ts";
30
30
 
31
31
  // ─── Settings ────────────────────────────────────────────────────────────────
32
32
 
@@ -98,6 +98,14 @@ export default function piOpenAgents(pi: ExtensionAPI): void {
98
98
  getActiveAgent: () => manager.getActive(),
99
99
  });
100
100
 
101
+ // Subagent child processes are fully configured by the executor via CLI flags
102
+ // (--model, --system-prompt, --tools). Do NOT apply defaultAgent — it would
103
+ // override the executor's model/tools/prompt settings.
104
+ if (isSubagentProcess(process.env)) {
105
+ updateBanner(ctx.ui, undefined, 0);
106
+ return;
107
+ }
108
+
101
109
  // Check for --agent CLI flag first (highest priority)
102
110
  const agentFlag = pi.getFlag("agent");
103
111
  if (typeof agentFlag === "string" && agentFlag) {
@@ -144,6 +152,10 @@ export default function piOpenAgents(pi: ExtensionAPI): void {
144
152
  // ── Before Agent Start: Inject system prompt + subagent guidance ─────────
145
153
 
146
154
  pi.on("before_agent_start", async (event) => {
155
+ // Skip system prompt modification in subagent child processes
156
+ // (executor sets system prompt via --system-prompt CLI flag)
157
+ if (isSubagentProcess(process.env)) return;
158
+
147
159
  const active = manager.getActive();
148
160
  let prompt = event.systemPrompt;
149
161