pi-cohort 6.1.0 → 6.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [6.1.1] - 2026-09-17
4
+
5
+ ### Fixed
6
+
7
+ - Child steps with an `outputSchema` now keep the `structured_output` tool when the resolved agent has a tool allowlist (`tools`, `toolsPrepend`, or `toolsAppend` in effect). Previously the allowlist dropped the extension-registered `structured_output` tool while the prompt still instructed the child to call it, so the step could never satisfy its structured output contract.
8
+
3
9
  ## [6.1.0] - 2026-09-12
4
10
 
5
11
  External execution backends currently require a non-Windows host. Native execution remains supported on Windows.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-cohort",
3
- "version": "6.1.0",
3
+ "version": "6.1.1",
4
4
  "description": "Delegate Pi work to focused child agents: code review, scouting, implementation, parallel audits, saved chains, and background jobs.",
5
5
  "author": "Jacek Juraszek",
6
6
  "license": "MIT",
@@ -3,7 +3,7 @@ import * as os from "node:os";
3
3
  import * as path from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import { encodeNestedPathEnv, parseNestedPathEnv, type NestedPathEntry } from "./nested-path.ts";
6
- import { STRUCTURED_OUTPUT_CAPTURE_ENV, STRUCTURED_OUTPUT_SCHEMA_ENV } from "./structured-output.ts";
6
+ import { STRUCTURED_OUTPUT_CAPTURE_ENV, STRUCTURED_OUTPUT_SCHEMA_ENV, STRUCTURED_OUTPUT_TOOL_NAME } from "./structured-output.ts";
7
7
  import type { JsonSchemaObject } from "../../shared/types.ts";
8
8
 
9
9
  const THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh"];
@@ -116,6 +116,11 @@ export function buildPiArgs(input: BuildPiArgsInput, fileSystem: BuildPiArgsFile
116
116
  }
117
117
  }
118
118
  if (builtinTools.length > 0) {
119
+ // The prompt runtime registers structured_output on demand; an allowlist
120
+ // without it would strand the tool the child is instructed to call.
121
+ if (input.structuredOutput && !builtinTools.includes(STRUCTURED_OUTPUT_TOOL_NAME)) {
122
+ builtinTools.push(STRUCTURED_OUTPUT_TOOL_NAME);
123
+ }
119
124
  args.push("--tools", builtinTools.join(","));
120
125
  }
121
126
  }
@@ -6,6 +6,9 @@ import type { JsonSchemaObject } from "../../shared/types.ts";
6
6
 
7
7
  export const STRUCTURED_OUTPUT_SCHEMA_ENV = "PI_SUBAGENT_STRUCTURED_OUTPUT_SCHEMA";
8
8
  export const STRUCTURED_OUTPUT_CAPTURE_ENV = "PI_SUBAGENT_STRUCTURED_OUTPUT_CAPTURE";
9
+ // Registered by subagent-prompt-runtime.ts whenever the capture env is set; child
10
+ // `--tools` allowlists must keep this name or the tool is filtered out of the toolbelt.
11
+ export const STRUCTURED_OUTPUT_TOOL_NAME = "structured_output";
9
12
 
10
13
  export interface StructuredOutputRuntime {
11
14
  schema: JsonSchemaObject;
@@ -2,7 +2,7 @@ import * as fs from "node:fs";
2
2
  import * as path from "node:path";
3
3
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
4
4
  import { SUBAGENT_FANOUT_CHILD_ENV } from "./pi-args.ts";
5
- import { STRUCTURED_OUTPUT_CAPTURE_ENV, STRUCTURED_OUTPUT_SCHEMA_ENV, validateStructuredOutputValue } from "./structured-output.ts";
5
+ import { STRUCTURED_OUTPUT_CAPTURE_ENV, STRUCTURED_OUTPUT_SCHEMA_ENV, STRUCTURED_OUTPUT_TOOL_NAME, validateStructuredOutputValue } from "./structured-output.ts";
6
6
  import type { JsonSchemaObject } from "../../shared/types.ts";
7
7
 
8
8
  const SUBAGENT_INHERIT_PROJECT_CONTEXT_ENV = "PI_SUBAGENT_INHERIT_PROJECT_CONTEXT";
@@ -10,7 +10,7 @@ const SUBAGENT_INHERIT_SKILLS_ENV = "PI_SUBAGENT_INHERIT_SKILLS";
10
10
 
11
11
  const STRUCTURED_OUTPUT_INSTRUCTIONS = [
12
12
  "This subagent step has a strict structured output contract.",
13
- "Your final action must be to call the `structured_output` tool with JSON matching the provided schema.",
13
+ "Your final action must be to call the `" + STRUCTURED_OUTPUT_TOOL_NAME + "` tool with JSON matching the provided schema.",
14
14
  "Do not rely on prose-only completion; if you do not call `structured_output`, the parent will fail this step.",
15
15
  ].join("\n");
16
16
 
@@ -194,7 +194,7 @@ export default function registerSubagentPromptRuntime(pi: ExtensionAPI): void {
194
194
  execute: (_id: string, params: { value: unknown }) => Promise<unknown>;
195
195
  }) => void;
196
196
  registerTool({
197
- name: "structured_output",
197
+ name: STRUCTURED_OUTPUT_TOOL_NAME,
198
198
  label: "Structured Output",
199
199
  description: "Submit the required final structured output for this subagent step. This terminates the step.",
200
200
  parameters: parameters as never,