@henryqw/pi-subagent 4.1.0 → 4.1.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/dist/index.js +2 -1
- package/docs/orchestration.md +2 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12,6 +12,7 @@ const MULTI_CODEX_EXTENSION = fileURLToPath(import.meta.resolve("@henryqw/pi-mul
|
|
|
12
12
|
const ROLE_TOOLS_EXTENSION = fileURLToPath(new URL("../extensions/role-tools.ts", import.meta.url));
|
|
13
13
|
export const ROLE_TOOL_POLICY_FLAG = "pi-subagent-role-tools";
|
|
14
14
|
export const CHILD_EXCLUDED_TOOLS = "delegate_task,ask_question,auto_dag_execute,auto_dag_acknowledge";
|
|
15
|
+
const CHILD_IDENTITY_POLICY = "You are a delegated Pi Subagent, not Main. Execute the assigned Role and task directly. Main-only delegation rules do not apply. Recursive delegation is unavailable; do not seek or invoke delegation tools.";
|
|
15
16
|
const cleanText = (value, field, source) => {
|
|
16
17
|
if (typeof value !== "string" || !value.trim() || value.includes("\0")) {
|
|
17
18
|
throw new Error(`${source}: ${field} must be non-empty text.`);
|
|
@@ -184,7 +185,7 @@ export function createRoleLaunch(pi, ctx, input) {
|
|
|
184
185
|
if (input.route.thinkingLevel)
|
|
185
186
|
args.push("--thinking", input.route.thinkingLevel);
|
|
186
187
|
args.push(ctx.isProjectTrusted() ? "--approve" : "--no-approve");
|
|
187
|
-
args.push("--append-system-prompt", cleanText(role.systemPrompt, "system prompt", `Role ${role.name}`));
|
|
188
|
+
args.push("--append-system-prompt", `${CHILD_IDENTITY_POLICY}\n\n${cleanText(role.systemPrompt, "system prompt", `Role ${role.name}`)}`);
|
|
188
189
|
return {
|
|
189
190
|
env,
|
|
190
191
|
args,
|
package/docs/orchestration.md
CHANGED
|
@@ -96,6 +96,8 @@ If steps must share files, make that an explicit caller decision: use an intenti
|
|
|
96
96
|
|
|
97
97
|
## Resource Policy
|
|
98
98
|
|
|
99
|
+
Every Role launch centrally prepends this child identity contract to its system instructions before the Role prompt: the child is a delegated Pi Subagent, not Main; it executes its assigned Role and task directly; Main-only delegation rules do not apply; recursive delegation is unavailable and it must not seek or invoke delegation tools.
|
|
100
|
+
|
|
99
101
|
A Role file owns:
|
|
100
102
|
|
|
101
103
|
- base tools (`tools` omitted does not itself define an allowlist; `tools: []` means extension tools only);
|