pi-better-harness 0.10.0 → 0.11.0
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/node_modules/pi-better-subagents/README.md +7 -0
- package/node_modules/pi-better-subagents/agent-inspection.ts +28 -0
- package/node_modules/pi-better-subagents/agents-catalog-tool.ts +2 -1
- package/node_modules/pi-better-subagents/batch.mjs +2 -2
- package/node_modules/pi-better-subagents/catalog-runtime.ts +52 -1
- package/node_modules/pi-better-subagents/docs/agent-catalog-operations.md +2 -0
- package/node_modules/pi-better-subagents/index.ts +19 -13
- package/node_modules/pi-better-subagents/package.json +1 -1
- package/package.json +2 -2
|
@@ -43,6 +43,13 @@ uses `agents_catalog` to discover current role descriptions and delegates every
|
|
|
43
43
|
nontrivial role-owned task, while the foreground coordinates, integrates, and
|
|
44
44
|
verifies. See [usage notes](docs/usage.md#delegation-mode).
|
|
45
45
|
|
|
46
|
+
`agents_catalog` shows each role's and named agent's default model and effort,
|
|
47
|
+
such as `default openai/gpt-6-sol@high`. To launch on that default, omit
|
|
48
|
+
`model` and `thinking` on a role or agent spawn; name one only for a stated
|
|
49
|
+
reason. When a launch's model or effort differs from the default, its launch
|
|
50
|
+
line says so, for example
|
|
51
|
+
`model openai/gpt-6-astra@high (role default openai/gpt-6-sol@high)`.
|
|
52
|
+
|
|
46
53
|
## When To Use
|
|
47
54
|
|
|
48
55
|
Use this package for independent coding, review, research, or verification work that can finish later. Do not use it for steps that need immediate foreground interaction or user clarification.
|
|
@@ -80,6 +80,23 @@ export interface OperationField {
|
|
|
80
80
|
inherited: boolean;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
export interface DefinitionDefaults {
|
|
84
|
+
model: string | null;
|
|
85
|
+
effort: string | null;
|
|
86
|
+
/** Compact `model@effort` form, as shown in the catalog list and launch notes. */
|
|
87
|
+
label: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** `model@effort`, `model`, or `effort <level>` when only an effort is set. Undefined when neither is set. */
|
|
91
|
+
export function formatModelEffort(model: string | null | undefined, effort: string | null | undefined): string | undefined {
|
|
92
|
+
const m = typeof model === "string" && model.trim() !== "" ? model : undefined;
|
|
93
|
+
const e = typeof effort === "string" && effort.trim() !== "" ? effort : undefined;
|
|
94
|
+
if (m && e) return `${m}@${e}`;
|
|
95
|
+
if (m) return m;
|
|
96
|
+
if (e) return `effort ${e}`;
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
|
|
83
100
|
export interface OperationCapabilities {
|
|
84
101
|
grantedByCatalog: false;
|
|
85
102
|
sameAsLegacySpawn: true;
|
|
@@ -113,6 +130,8 @@ export interface OperationView {
|
|
|
113
130
|
instructionMode?: string;
|
|
114
131
|
instructions?: string;
|
|
115
132
|
fields?: { model: OperationField; effort: OperationField; tier: OperationField };
|
|
133
|
+
/** The definition's own default model and effort (role default, or the agent's override or inherited value). Null when neither is set. */
|
|
134
|
+
defaults: DefinitionDefaults | null;
|
|
116
135
|
requestedModel: string | null;
|
|
117
136
|
requestedEffort: string | null;
|
|
118
137
|
actualModel: string | null;
|
|
@@ -311,6 +330,7 @@ export function presentCatalogEntry(snapshot: CatalogSnapshot, id: string, enric
|
|
|
311
330
|
instructionMode: inspection.instructionMode,
|
|
312
331
|
instructions: inspection.instructions,
|
|
313
332
|
fields,
|
|
333
|
+
defaults: definitionDefaults(fields),
|
|
314
334
|
requestedModel: enrichment?.requestedModel ?? fields?.model.value ?? null,
|
|
315
335
|
requestedEffort: enrichment?.requestedEffort ?? (fields?.effort.value ?? null),
|
|
316
336
|
actualModel: enrichment?.actualModel ?? null,
|
|
@@ -350,6 +370,7 @@ export function renderOperationView(view: OperationView): string {
|
|
|
350
370
|
`definitionValid=${yesNo(view.definitionValid)}`,
|
|
351
371
|
`catalogLaunchable=${yesNo(view.catalogLaunchable)}`,
|
|
352
372
|
`launchable=${view.launchable === null ? "unknown" : yesNo(view.launchable)}`,
|
|
373
|
+
...(view.defaults ? [`default ${view.defaults.label}`] : []),
|
|
353
374
|
].join(" ");
|
|
354
375
|
const lines = [
|
|
355
376
|
header,
|
|
@@ -397,6 +418,13 @@ export function renderOperationView(view: OperationView): string {
|
|
|
397
418
|
return lines.join("\n");
|
|
398
419
|
}
|
|
399
420
|
|
|
421
|
+
function definitionDefaults(fields: OperationView["fields"]): DefinitionDefaults | null {
|
|
422
|
+
const model = fields?.model.value ?? null;
|
|
423
|
+
const effort = fields?.effort.value ?? null;
|
|
424
|
+
const label = formatModelEffort(model, effort);
|
|
425
|
+
return label ? { model, effort, label } : null;
|
|
426
|
+
}
|
|
427
|
+
|
|
400
428
|
function field(value: { value: string | null; source: OperationField["source"]; explicit: boolean }): OperationField {
|
|
401
429
|
return {
|
|
402
430
|
value: value.value,
|
|
@@ -37,7 +37,7 @@ export function agentsCatalogTool(Type: TypeModule, deps: DiscoveryDeps = {}) {
|
|
|
37
37
|
return {
|
|
38
38
|
name: "agents_catalog" as const,
|
|
39
39
|
label: "Agents catalog",
|
|
40
|
-
description: "List or inspect role and named-agent definitions, including inheritance, diagnostics, restrictions, and whether launchability is actually known. This tool does not create, import, or edit definitions.",
|
|
40
|
+
description: "List or inspect role and named-agent definitions, including inheritance, default model and effort, diagnostics, restrictions, and whether launchability is actually known. This tool does not create, import, or edit definitions.",
|
|
41
41
|
promptSnippet: "List and inspect catalog roles and named agents, including inheritance and whether launchability is known.",
|
|
42
42
|
promptGuidelines: [
|
|
43
43
|
"Use agents_catalog to discover roles and named agents before subagent_spawn. It is read-only.",
|
|
@@ -46,6 +46,7 @@ export function agentsCatalogTool(Type: TypeModule, deps: DiscoveryDeps = {}) {
|
|
|
46
46
|
"Ask the user to run /agents create or /agents import-codex for writes. Those commands confirm role, scope, and import replacement.",
|
|
47
47
|
"Launch with the existing subagent_spawn or batch tool. Pass one agent or one role, not both. Two roles for one run need the user to choose one or split the work.",
|
|
48
48
|
"Put an authoritative model or effort on the structured invocation. Do not rely on copying a model name into the child prompt. Explicit invocation and workflow choices override definition defaults.",
|
|
49
|
+
"Each entry shows its default model@effort when set. Omit model and thinking on the spawn to use it; name one only for a stated reason.",
|
|
49
50
|
],
|
|
50
51
|
parameters: Type.Object({
|
|
51
52
|
action: Type.String({ description: "list or inspect. No other action is accepted." }),
|
|
@@ -215,8 +215,8 @@ export function formatBatchLaunchResponse({ batchId, batchName, launched, skippe
|
|
|
215
215
|
lines.push(
|
|
216
216
|
`Batch ${label} launched ${launched.length} subagent(s):`,
|
|
217
217
|
);
|
|
218
|
-
for (const { name, id } of launched) {
|
|
219
|
-
lines.push(`• ${name} → ${id}`);
|
|
218
|
+
for (const { name, id, modelNote } of launched) {
|
|
219
|
+
lines.push(`• ${name} → ${id}${modelNote ? ` · ${modelNote}` : ""}`);
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* `spawnSubagentRun`. This module does not grant tools, sandbox modes, or
|
|
5
5
|
* extensions, and it does not read task prose for model choices.
|
|
6
6
|
*/
|
|
7
|
-
import { describeDefaultLaunchCapabilities, LEGACY_CAPABILITY_CONTROLS, type LaunchEnricher, type LaunchEnrichment } from "./agent-inspection.ts";
|
|
7
|
+
import { describeDefaultLaunchCapabilities, formatModelEffort, LEGACY_CAPABILITY_CONTROLS, type LaunchEnricher, type LaunchEnrichment } from "./agent-inspection.ts";
|
|
8
8
|
import { resolveSelection, type EffectiveDefinition } from "./catalog-resolver.ts";
|
|
9
9
|
import { defaultUserRoot, loadCatalog, type CatalogSnapshot } from "./catalog-store.ts";
|
|
10
10
|
import { loadConfig, type SubagentConfig } from "./config.ts";
|
|
@@ -252,6 +252,57 @@ export async function clarifyCatalogRequest(
|
|
|
252
252
|
return { status: "resolved", jobs: ordered.map(stripBookkeeping) };
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
+
/**
|
|
256
|
+
* Launch-line note for a catalog run whose effective model or effort differs
|
|
257
|
+
* from the role or agent default. The wording names the cause, so a fallback
|
|
258
|
+
* or a capped effort is not mistaken for a caller override:
|
|
259
|
+
* - override: `model openai/gpt-6-astra@high (role default openai/gpt-6-sol@high)`
|
|
260
|
+
* - fallback: `model xai/grok-4.7@high (role default openai/gpt-6-sol@high unavailable; foreground fallback)`
|
|
261
|
+
* - capped effort: `model openai/gpt-6-sol@medium (role default openai/gpt-6-sol@high; effort capped at medium by the model)`
|
|
262
|
+
* Undefined for a non-catalog run, a definition with no default, or a launch
|
|
263
|
+
* that matches the default. Only the fields the definition sets are compared.
|
|
264
|
+
*/
|
|
265
|
+
export function catalogDefaultNote(
|
|
266
|
+
record: Pick<CatalogRunRecord, "kind" | "effective" | "modelSelection" | "effortSelection"> | undefined,
|
|
267
|
+
model: string | undefined,
|
|
268
|
+
thinking: string | undefined,
|
|
269
|
+
): string | undefined {
|
|
270
|
+
if (!record) return undefined;
|
|
271
|
+
const defaultModel = record.effective.model.value;
|
|
272
|
+
const defaultEffort = record.effective.effort.value;
|
|
273
|
+
const defaultLabel = formatModelEffort(defaultModel, defaultEffort);
|
|
274
|
+
if (!defaultLabel) return undefined;
|
|
275
|
+
const modelSource = record.modelSelection?.source;
|
|
276
|
+
const modelFallback = defaultModel !== null && modelSource !== undefined && FALLBACK_SOURCES.has(modelSource);
|
|
277
|
+
const modelDiffers = defaultModel !== null && (modelFallback || !sameModel(defaultModel, model, modelSource));
|
|
278
|
+
const effortCapped = defaultEffort !== null && record.effortSelection?.adjusted === true && (thinking ?? null) !== defaultEffort;
|
|
279
|
+
const effortDiffers = defaultEffort !== null && (thinking ?? null) !== defaultEffort;
|
|
280
|
+
if (!modelDiffers && !effortDiffers) return undefined;
|
|
281
|
+
const actual = formatModelEffort(model ?? "Pi default", thinking) ?? "Pi default";
|
|
282
|
+
const causes = [
|
|
283
|
+
modelFallback ? `${record.kind} default ${defaultLabel} unavailable; ${FALLBACK_LABELS[modelSource!] ?? modelSource} fallback` : `${record.kind} default ${defaultLabel}`,
|
|
284
|
+
...(effortCapped ? [`effort capped at ${thinking ?? "the model default"} by the model`] : []),
|
|
285
|
+
];
|
|
286
|
+
return `model ${actual} (${causes.join("; ")})`;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/** Model sources that mean the default could not be used, not that the caller chose another model. */
|
|
290
|
+
const FALLBACK_SOURCES: ReadonlySet<string> = new Set(["tier-candidate", "foreground", "configured-default"]);
|
|
291
|
+
const FALLBACK_LABELS: Record<string, string> = {
|
|
292
|
+
"tier-candidate": "same-tier",
|
|
293
|
+
foreground: "foreground",
|
|
294
|
+
"configured-default": "configured-default",
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
function sameModel(defaultModel: string, actual: string | undefined, source: string | undefined): boolean {
|
|
298
|
+
// The resolver launched the definition's own preference: same model, however it was spelled.
|
|
299
|
+
if (source === "role-default" || source === "agent-override") return true;
|
|
300
|
+
if (actual === undefined) return false;
|
|
301
|
+
if (defaultModel === actual) return true;
|
|
302
|
+
// A providerless default names the id; the resolved provider/id (the id may itself contain "/") still matches.
|
|
303
|
+
return !defaultModel.includes("/") ? actual.endsWith(`/${defaultModel}`) : false;
|
|
304
|
+
}
|
|
305
|
+
|
|
255
306
|
export async function prepareCatalogJob(snapshot: CatalogSnapshot, job: CatalogJobFields, host: CatalogHost): Promise<PreparedCatalogJob> {
|
|
256
307
|
const agent = agentIdOf(job);
|
|
257
308
|
const roles = roleIdsOf(job);
|
|
@@ -52,6 +52,8 @@ Codex applies the agent file's model and `model_reasoning_effort` ahead of the c
|
|
|
52
52
|
|
|
53
53
|
`agents_catalog` accepts `list` and `inspect` only. It uses the same inspection view as `/agents show`. It has no write path. Launch remains `subagent_spawn` or the batch tool, with at most one `agent` or `role` selector. Those selectors are lifecycle's wiring, not this tool.
|
|
54
54
|
|
|
55
|
+
Each list line and the inspect header end with the definition's default model and effort when one is set, such as `default openai/gpt-6-sol@high`: a role's own default, or a named agent's override or inherited role default. The structured view carries the same value as `defaults: { model, effort, label }`, or `null` when neither is set. A spawn that omits `model` and `thinking` uses it. When a catalog launch's model or effort differs from it, the launch line (and each batch job line) adds a note such as `model openai/gpt-6-astra@high (role default openai/gpt-6-sol@high)`. Only the fields the definition sets are compared. The note names the cause: a fallback from an unavailable default reads `(role default openai/gpt-6-sol@high unavailable; foreground fallback)` (or `same-tier` / `configured-default`), and an effort the model cannot run adds `effort capped at <level> by the model`.
|
|
56
|
+
|
|
55
57
|
## Lifecycle attachment
|
|
56
58
|
|
|
57
59
|
```ts
|
|
@@ -151,6 +151,7 @@ import {
|
|
|
151
151
|
loadLaunchSnapshot,
|
|
152
152
|
noteCatalogHost,
|
|
153
153
|
prepareCatalogJob,
|
|
154
|
+
catalogDefaultNote,
|
|
154
155
|
tiersForLaunch,
|
|
155
156
|
type CatalogHost,
|
|
156
157
|
type CatalogJobFields,
|
|
@@ -175,6 +176,7 @@ const projectConfigDirName = typeof (PiCodingAgent as { CONFIG_DIR_NAME?: unknow
|
|
|
175
176
|
: ".pi";
|
|
176
177
|
|
|
177
178
|
const CATALOG_GUIDELINES = [
|
|
179
|
+
"With an agent or role, omit model and thinking to launch on its default model and effort, which agents_catalog shows. Name a model or effort only for a stated reason, such as a task or workflow instruction, and never copy one from another role's runs.",
|
|
178
180
|
"When a task, workflow, or skill instruction names a model or effort, translate that authoritative choice into the structured model and thinking arguments before spawning. The runtime does not parse prose, quoted model names, or comparisons, and copying a model into the child prompt does not change the launch.",
|
|
179
181
|
"Optional agent, role, and alias select a catalog definition. Pass one agent id or one role id. Pass an array of role ids when one run was given more than one role: that call asks to choose one or split, and without a UI choice it returns clarification-needed and starts no child. Naming both an agent and a role does the same. One job's choice does not change another job. A named agent displays its defined name. A direct role displays the label allocated from the local run registry. Calls without agent or role keep the existing name and model chain.",
|
|
180
182
|
"Catalog model and effort are resolved before the child starts. An unavailable explicit model or unsupported explicit effort does not launch and does not fall back. The catalog grants no tools, sandbox modes, extensions, or permissions.",
|
|
@@ -1551,6 +1553,8 @@ export default function (pi: ExtensionAPI) {
|
|
|
1551
1553
|
runtime: string;
|
|
1552
1554
|
warn: string;
|
|
1553
1555
|
sandboxDir?: string;
|
|
1556
|
+
/** Set only when a catalog run's model or effort differs from its role or agent default. */
|
|
1557
|
+
modelNote?: string;
|
|
1554
1558
|
}> {
|
|
1555
1559
|
assertThinkingLevel(p.thinking);
|
|
1556
1560
|
const permissionPlan = resolveSubagentPermissions(pi, p.sandbox);
|
|
@@ -1766,7 +1770,8 @@ export default function (pi: ExtensionAPI) {
|
|
|
1766
1770
|
`${resolution.unmapped.length > 1 ? "these tools" : "this tool"} will NOT exist in the child. ` +
|
|
1767
1771
|
`Add a toolExtensions entry in config.json.\n`
|
|
1768
1772
|
: "");
|
|
1769
|
-
|
|
1773
|
+
const modelNote = catalogDefaultNote(p.catalog, model, thinking);
|
|
1774
|
+
return { id, meta, spawned, runtime: runtime + (meta.timing ? `${formatTimingLimits(meta.timing, startedAt)}\n` : ""), warn, sandboxDir, modelNote };
|
|
1770
1775
|
}
|
|
1771
1776
|
|
|
1772
1777
|
// ---- subagent_spawn -------------------------------------------------
|
|
@@ -1783,7 +1788,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1783
1788
|
"After subagent_spawn, do NOT call subagent_output or subagent_result in a loop to wait for the result, and do NOT sleep. The run completes on its own and reports back on the next turn.",
|
|
1784
1789
|
"Call subagent_result after a completion or attention callback, or when the user explicitly asks for the result. Use subagent_output only when the user explicitly asks how a run is progressing; never use either tool to poll.",
|
|
1785
1790
|
...SUBAGENT_ORCHESTRATION_GUIDELINES,
|
|
1786
|
-
"The tools param is both the tool allowlist AND what determines which extensions load in the child (e.g. tools='read,bash,web_fetch' loads only the web-tools package). Ask for the tools the task needs and nothing more; clean:true gives a built-ins-only child.
|
|
1791
|
+
"The tools param is both the tool allowlist AND what determines which extensions load in the child (e.g. tools='read,bash,web_fetch' loads only the web-tools package). Ask for the tools the task needs and nothing more; clean:true gives a built-ins-only child. Without an agent or role, pick a model with the model param (e.g. 'xai/grok-4.5@high'); providerless model patterns are resolved by Pi, while provider/model is deterministic and loads mapped provider extensions.",
|
|
1787
1792
|
...CATALOG_GUIDELINES,
|
|
1788
1793
|
"By default the subagent is sandboxed. Human settings in /sandbox control file, credential-file, command, and network permissions; sandbox:false cannot override an enabled human profile. Without published settings, legacy write confinement applies. Set callback:false to finish quietly — then read the result on demand via subagent_result.",
|
|
1789
1794
|
"Every run is timed by the harness: a soft deadline (default 30 min) steers the child to wrap up and wakes you once, the run is stopped after grace_minutes (reason deadline), a hard ceiling (default 90 min) stops it without grace (reason ceiling), and no progress for stuck_minutes (default 10) wakes you once (reason stuck). Set deadline_minutes/max_minutes/stuck_minutes to fit the task instead of writing a time limit into the prompt; do not stop a slow child that is still making progress.",
|
|
@@ -1795,8 +1800,8 @@ export default function (pi: ExtensionAPI) {
|
|
|
1795
1800
|
agent: Type.Optional(Type.String({ description: "Named agent id (agent.<slug>). Mutually exclusive with role. The navigator shows the defined agent name." })),
|
|
1796
1801
|
role: catalogRoleSchema("direct role launch"),
|
|
1797
1802
|
alias: Type.Optional(Type.String({ description: "Per-run display alias for a direct role launch, such as checkout. Not a reusable agent. Colliding aliases gain a numeric suffix." })),
|
|
1798
|
-
model: Type.Optional(Type.String({ description: "Pi model pattern, preferably provider/id, optionally suffixed with @effort (for example openai/gpt-5.5@high). Providerless patterns are resolved by Pi.
|
|
1799
|
-
thinking: Type.Optional(Type.String({ description: "Reasoning effort for the child: off, minimal, low, medium, high, xhigh, or max
|
|
1803
|
+
model: Type.Optional(Type.String({ description: "Pi model pattern, preferably provider/id, optionally suffixed with @effort (for example openai/gpt-5.5@high). Providerless patterns are resolved by Pi. Omit to use the agent or role default; without one, inherit the foreground model. Put authoritative model choices here; do not rely on prompt text." })),
|
|
1804
|
+
thinking: Type.Optional(Type.String({ description: "Reasoning effort for the child: off, minimal, low, medium, high, xhigh, or max. Omit to use the agent or role default; without one, the Pi/model default." })),
|
|
1800
1805
|
tools: Type.Optional(Type.String({ description: "Tool allowlist: comma-separated names the child may use (e.g. 'read,bash,web_fetch'). This ALSO selects which extensions load — only packages backing a requested tool are loaded. Defaults to the configured safe set." })),
|
|
1801
1806
|
exclude_tools: Type.Optional(Type.String({ description: "Comma-separated tool denylist, applied on top of the allowlist." })),
|
|
1802
1807
|
clean: Type.Optional(Type.Boolean({ description: "Run a hermetic child with NO extensions at all (only built-ins: read, bash, edit, write). Default false — the extensions backing the requested tools load, so web_fetch and model auth (e.g. xai) work." })),
|
|
@@ -1841,21 +1846,22 @@ export default function (pi: ExtensionAPI) {
|
|
|
1841
1846
|
throw new Error(`Choosing split needs ${catalog.jobs.length} subagent slots, but only one was free. Nothing was launched.`);
|
|
1842
1847
|
}
|
|
1843
1848
|
reserved += extra;
|
|
1844
|
-
const launched: { name?: string; id: string }[] = [];
|
|
1849
|
+
const launched: { name?: string; id: string; modelNote?: string }[] = [];
|
|
1845
1850
|
for (const job of catalog.jobs) {
|
|
1846
|
-
const { id } = await spawnSubagentRun(ctx, job);
|
|
1851
|
+
const { id, modelNote } = await spawnSubagentRun(ctx, job);
|
|
1847
1852
|
gate.commit(1);
|
|
1848
1853
|
reserved -= 1;
|
|
1849
|
-
launched.push({ name: job.name, id });
|
|
1854
|
+
launched.push({ name: job.name, id, modelNote });
|
|
1850
1855
|
}
|
|
1851
|
-
return text(launched.map((item) => `Subagent launched: ${item.name ? `${item.name} ` : ""}id=${item.id}.`).join("\n"));
|
|
1856
|
+
return text(launched.map((item) => `Subagent launched: ${item.name ? `${item.name} ` : ""}id=${item.id}.${item.modelNote ? ` ${item.modelNote}.` : ""}`).join("\n"));
|
|
1852
1857
|
}
|
|
1853
1858
|
Object.assign(p, catalog.jobs[0]);
|
|
1854
|
-
const { id, spawned, runtime, warn, sandboxDir } = await spawnSubagentRun(ctx, p);
|
|
1859
|
+
const { id, spawned, runtime, warn, sandboxDir, modelNote } = await spawnSubagentRun(ctx, p);
|
|
1855
1860
|
gate.commit(1);
|
|
1856
1861
|
reserved = 0;
|
|
1857
1862
|
return text(
|
|
1858
1863
|
`Subagent launched: ${p.name ? `${p.name} ` : ""}id=${id} (pid ${spawned.pid}).\n` +
|
|
1864
|
+
(modelNote ? `${modelNote[0]!.toUpperCase()}${modelNote.slice(1)}.\n` : "") +
|
|
1859
1865
|
(p.callback === false
|
|
1860
1866
|
? `Running in the background; the foreground is free. It will finish quietly — read the result with subagent_result id=${id}.\n`
|
|
1861
1867
|
: `Running in the background; the foreground is free. Its result will be posted back here when it finishes.\n`) +
|
|
@@ -1898,7 +1904,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1898
1904
|
agent: Type.Optional(Type.String({ description: "Named agent id applied to jobs that do not select their own agent or role." })),
|
|
1899
1905
|
role: catalogRoleSchema("shared role selector"),
|
|
1900
1906
|
alias: Type.Optional(Type.String({ description: "Direct-role alias applied when a job does not set alias." })),
|
|
1901
|
-
model: Type.Optional(Type.String({ description: "Pi model pattern, preferably provider/id, optionally suffixed with @effort
|
|
1907
|
+
model: Type.Optional(Type.String({ description: "Pi model pattern, preferably provider/id, optionally suffixed with @effort. Omit to use the agent or role default; without one, inherit the foreground model. Put authoritative model choices here; prompt text is not parsed." })),
|
|
1902
1908
|
thinking: Type.Optional(Type.String({ description: "Reasoning effort applied to every job: off, minimal, low, medium, high, xhigh, or max." })),
|
|
1903
1909
|
tools: Type.Optional(Type.String({ description: "Tool allowlist applied to every job." })),
|
|
1904
1910
|
exclude_tools: Type.Optional(Type.String({ description: "Comma-separated tool denylist applied to every job." })),
|
|
@@ -1997,7 +2003,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1997
2003
|
|
|
1998
2004
|
const names = assignBatchJobNames(p.jobs);
|
|
1999
2005
|
const batchId = nextBatchId();
|
|
2000
|
-
const launched: { name: string; id: string }[] = [];
|
|
2006
|
+
const launched: { name: string; id: string; modelNote?: string }[] = [];
|
|
2001
2007
|
const failed: { name: string; reason: string }[] = [];
|
|
2002
2008
|
const skipped: { name: string }[] = [];
|
|
2003
2009
|
// How many reject-mode reserved slots are still held (not yet committed/released).
|
|
@@ -2035,10 +2041,10 @@ export default function (pi: ExtensionAPI) {
|
|
|
2035
2041
|
name = prepared.assign.name;
|
|
2036
2042
|
}
|
|
2037
2043
|
}
|
|
2038
|
-
const { id } = await spawnSubagentRun(ctx, { ...merged, name }, { batchId, batchName: p.batchName });
|
|
2044
|
+
const { id, modelNote } = await spawnSubagentRun(ctx, { ...merged, name }, { batchId, batchName: p.batchName });
|
|
2039
2045
|
gate.commit(1);
|
|
2040
2046
|
if (!launchAvailable) reservedRemaining -= 1;
|
|
2041
|
-
launched.push({ name, id });
|
|
2047
|
+
launched.push({ name, id, ...(modelNote ? { modelNote } : {}) });
|
|
2042
2048
|
} catch (err) {
|
|
2043
2049
|
gate.release(1);
|
|
2044
2050
|
if (!launchAvailable) reservedRemaining -= 1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-better-harness",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Pi extension bundle for a write sandbox, subagents, background tasks, SSH, goals, and structured plans.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"pi-better-plan": "0.5.0",
|
|
56
56
|
"pi-better-sandbox": "0.7.1",
|
|
57
57
|
"pi-better-ssh": "0.1.1",
|
|
58
|
-
"pi-better-subagents": "0.
|
|
58
|
+
"pi-better-subagents": "0.8.0",
|
|
59
59
|
"smol-toml": "1.9.0",
|
|
60
60
|
"yaml": "^2.9.1"
|
|
61
61
|
},
|