pi-subagent-manager 1.7.1 → 1.9.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/agents/architect.md +1 -1
- package/agents/coder.md +2 -2
- package/agents/tasker.md +2 -2
- package/docs/default-agents.md +7 -7
- package/package.json +1 -1
- package/src/index.ts +3 -0
- package/src/orch/context-entries.ts +15 -0
- package/src/orch/manager.ts +16 -1
- package/src/orch/runtime.ts +7 -0
- package/src/types.ts +10 -0
package/agents/architect.md
CHANGED
|
@@ -46,7 +46,7 @@ You are the architect. You decide what should be built and how, and you coordina
|
|
|
46
46
|
|
|
47
47
|
- Use agent_types to see available roles. Give each child a self-contained brief: goal, scope, context, owned files, output format, and how to verify.
|
|
48
48
|
- Start independent children with wait: false, then wait on them. Concurrent writers get disjoint files. Use agent_steer for scope drift; stop children you no longer need. Stay within concurrency and depth limits.
|
|
49
|
-
-
|
|
49
|
+
- Delegate bounded coding and routine operations to tasker; complex or sustained implementation goes to coder, not to you.
|
|
50
50
|
- Check each handback against the actual files and command output before building on it.
|
|
51
51
|
|
|
52
52
|
## Boundaries
|
package/agents/coder.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: coder
|
|
3
3
|
icon: ""
|
|
4
|
-
description: Own
|
|
4
|
+
description: Own complex or long-running implementation, refactoring, debugging, and frontend UI through a checked patch. Use tasker for bounded coding and routine operations.
|
|
5
5
|
thinkingLevel: high
|
|
6
6
|
color: mdCode
|
|
7
7
|
modelSuggestions:
|
|
@@ -22,7 +22,7 @@ tools:
|
|
|
22
22
|
- agent_pause
|
|
23
23
|
---
|
|
24
24
|
|
|
25
|
-
You are a coder.
|
|
25
|
+
You are a coder. Own complex or sustained features, refactors, debugging, or frontend UI through a patch you have built or tested yourself. Bounded coding and routine operations go to tasker, review-only passes to reviewer, and plans to architect.
|
|
26
26
|
|
|
27
27
|
## Approach
|
|
28
28
|
|
package/agents/tasker.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tasker
|
|
3
3
|
icon: ""
|
|
4
|
-
description: Complete
|
|
4
|
+
description: Complete bounded jobs with clear criteria, including small coding tasks, scripts, SQL or database queries, git housekeeping, diagnostics, and targeted lookups. Not for complex or sustained implementation.
|
|
5
5
|
thinkingLevel: low
|
|
6
6
|
color: success
|
|
7
7
|
modelSuggestions:
|
|
@@ -21,7 +21,7 @@ tools:
|
|
|
21
21
|
- agent_pause
|
|
22
22
|
---
|
|
23
23
|
|
|
24
|
-
You are a tasker. Do one bounded, well-specified job: a
|
|
24
|
+
You are a tasker. Do one bounded, well-specified job: a small coding task, script, SQL or database query, git housekeeping, diagnostic, data extraction, or targeted repository lookup. Do exactly that and return a compact answer. Not every job needs a file change.
|
|
25
25
|
|
|
26
26
|
## Before you start
|
|
27
27
|
|
package/docs/default-agents.md
CHANGED
|
@@ -9,15 +9,15 @@ The original model shortlist was audited **October 4, 2026 local time (October 3
|
|
|
9
9
|
| Role | Work and boundaries | Thinking |
|
|
10
10
|
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
|
|
11
11
|
| `architect` | Design, ambiguity, tradeoffs, verifiable plans, and explicitly authorized coordination. Not an implementation mandate or an unlimited research job. | `high` |
|
|
12
|
-
| `coder` |
|
|
12
|
+
| `coder` | Complex or sustained implementation, refactoring, debugging, and frontend UI through a checked patch. | `high` |
|
|
13
13
|
| `researcher` | Source-backed local/remote codebase, library/API, and internet research; verification and synthesis. No implementation edits or delegation. | `medium` |
|
|
14
14
|
| `reviewer` | Scoped, non-mutating correctness/security review with demonstrable defects and minimal local repair suggestions. No implementation or comment quota. | `high` |
|
|
15
|
-
| `tasker` |
|
|
15
|
+
| `tasker` | Bounded coding, scripts, SQL/database queries, git housekeeping, diagnostics, and lookups. Escalate complex or sustained implementation. | `low` |
|
|
16
16
|
| `writer` | Original or revised prose for a stated audience and voice, using supplied/local evidence. No invented facts or live evidence gathering. | `medium` |
|
|
17
17
|
|
|
18
18
|
Use tasker for one symbol or a few facts already in the repository; use researcher for tracing behavior across a codebase, versioned API evidence, outside sources, or contradictory claims. Researcher gathers what is true; architect decides what to build. Writer turns verified material into prose.
|
|
19
19
|
|
|
20
|
-
Existing user/project `researcher` overrides still win over the new packaged default. Bundled `worker`, `explorer`, and `designer` remain absent: bounded work routes to tasker,
|
|
20
|
+
Existing user/project `researcher` overrides still win over the new packaged default. Bundled `worker`, `explorer`, and `designer` remain absent: bounded work routes to tasker, complex or sustained implementation to coder, and source investigation to researcher. Nothing is automatically renamed.
|
|
21
21
|
|
|
22
22
|
## Nerd Font icons
|
|
23
23
|
|
|
@@ -43,10 +43,10 @@ Every `modelSuggestions` entry is a single plain model-name string suitable for
|
|
|
43
43
|
| Role | Suggested names, in order | Rationale |
|
|
44
44
|
| ---------- | ------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
45
45
|
| architect | `opus-5.5`, `gpt-6-astra`, `fable-5.1`, `kimi-k3` | Heavyweight, quality-first reasoning for ambiguous architecture, difficult constraints, and consequential plans; Kimi is the user-selected long-context alternative. |
|
|
46
|
-
| coder | `sonnet-5.5`, `gpt-6.1-sol`, `kimi-k3.1-pro`, `muse-wonder-full-1.0`
|
|
47
|
-
| researcher | `gpt-6.1-terra`, `sonnet-5.5`, `muse-spark-1.3`
|
|
48
|
-
| reviewer | `gpt-6.1-sol`, `sonnet-5.5`, `opus-5.5`, `glm-5.3`, `gemini-4-argon`
|
|
49
|
-
| tasker | `gpt-6-luna`, `haiku-5.5`, `deepseek-v4.1-flash-1017`
|
|
46
|
+
| coder | `sonnet-5.5`, `gpt-6.1-sol`, `kimi-k3.1-pro`, `muse-wonder-full-1.0` | User-selected implementation shortlist, with high thinking by default. |
|
|
47
|
+
| researcher | `gpt-6.1-terra`, `sonnet-5.5`, `muse-spark-1.3` | User-selected research shortlist, with medium thinking by default; no matched research-citation tournament is claimed. |
|
|
48
|
+
| reviewer | `gpt-6.1-sol`, `sonnet-5.5`, `opus-5.5`, `glm-5.3`, `gemini-4-argon` | Reasoning and code evidence, without treating premium Astra as necessary for every review. |
|
|
49
|
+
| tasker | `gpt-6-luna`, `haiku-5.5`, `deepseek-v4.1-flash-1017` | User-selected bounded-task shortlist, with low thinking by default. |
|
|
50
50
|
| writer | `opus-5.5`, `gemini-4-argon`, `gemini-3.8-flash`, `fable-5.1`, `muse-spark-1.3` | Quality-sensitive editorial work, creative-writing Arena candidates, low-cost drafting, and a user-selected Muse alternative. |
|
|
51
51
|
|
|
52
52
|
These are choices, not an automatic fallback/escalation chain or a universal quality ranking. Model aliases were checked against `pi --list-models`, including `claude-haiku-5-5`, `claude-sonnet-5-5`, and `moonshotai/kimi-k3.1-pro`; fuzzy suggestions omit provider paths and normalize version separators. The historical audit is not a new benchmark evaluation of these updates. Deep-research product results are not automatically results for their underlying base models.
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
offerAgentImport,
|
|
15
15
|
} from "./prefs/agent-import.ts";
|
|
16
16
|
import { ThreadManager } from "./orch/manager.ts";
|
|
17
|
+
import { inheritedContextEntries } from "./orch/context-entries.ts";
|
|
17
18
|
import { loadManagerSettings } from "./prefs/settings.ts";
|
|
18
19
|
import { configureAgents } from "./ui/settings-ui.ts";
|
|
19
20
|
import { AgentNavigationController } from "./ui/status-ui.ts";
|
|
@@ -656,6 +657,8 @@ export default function piSubagent(pi: ExtensionAPI): void {
|
|
|
656
657
|
...limits,
|
|
657
658
|
createDriver: driverFactory,
|
|
658
659
|
rootSnapshot: () => buildSessionContext(requireContext().sessionManager.getBranch()).messages,
|
|
660
|
+
rootContextEntries: () =>
|
|
661
|
+
inheritedContextEntries(requireContext().sessionManager.getBranch()),
|
|
659
662
|
getType: (name) => store.get(name),
|
|
660
663
|
toolsFor,
|
|
661
664
|
onEventError: (error, event) => {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { InheritedContextEntry } from "../types.ts";
|
|
2
|
+
|
|
3
|
+
/** Preserve only pruner state; other extension state is private to its session. */
|
|
4
|
+
export function inheritedContextEntries(
|
|
5
|
+
branch: readonly { type: string; customType?: string; data?: unknown }[],
|
|
6
|
+
): InheritedContextEntry[] {
|
|
7
|
+
return structuredClone(
|
|
8
|
+
branch.flatMap((entry) =>
|
|
9
|
+
entry.type === "custom" &&
|
|
10
|
+
(entry.customType === "context-prune-index" || entry.customType === "context-prune-frontier")
|
|
11
|
+
? [{ customType: entry.customType, data: entry.data }]
|
|
12
|
+
: [],
|
|
13
|
+
),
|
|
14
|
+
);
|
|
15
|
+
}
|
package/src/orch/manager.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type {
|
|
|
4
4
|
AgentDriver,
|
|
5
5
|
AgentType,
|
|
6
6
|
DriverOptions,
|
|
7
|
+
InheritedContextEntry,
|
|
7
8
|
ManagerOptions,
|
|
8
9
|
SavedThread,
|
|
9
10
|
SavedThreadView,
|
|
@@ -22,6 +23,7 @@ interface Record {
|
|
|
22
23
|
view: ThreadView;
|
|
23
24
|
definition: AgentType;
|
|
24
25
|
inherited: AgentMessage[];
|
|
26
|
+
inheritedContextEntries: InheritedContextEntry[];
|
|
25
27
|
contextReady?: Promise<void>;
|
|
26
28
|
contextPending?: boolean;
|
|
27
29
|
startup: AbortController;
|
|
@@ -232,7 +234,10 @@ export class ThreadManager {
|
|
|
232
234
|
view,
|
|
233
235
|
definition: structuredClone(record.definition),
|
|
234
236
|
...(!view.sessionFile && !record.contextPending
|
|
235
|
-
? {
|
|
237
|
+
? {
|
|
238
|
+
inherited: structuredClone(record.inherited),
|
|
239
|
+
inheritedContextEntries: structuredClone(record.inheritedContextEntries),
|
|
240
|
+
}
|
|
236
241
|
: {}),
|
|
237
242
|
};
|
|
238
243
|
});
|
|
@@ -274,6 +279,7 @@ export class ThreadManager {
|
|
|
274
279
|
view,
|
|
275
280
|
definition: structuredClone(item.definition),
|
|
276
281
|
inherited: structuredClone(item.inherited ?? []),
|
|
282
|
+
inheritedContextEntries: structuredClone(item.inheritedContextEntries ?? []),
|
|
277
283
|
// A reservation saved before its lexical parent opened has no snapshot yet.
|
|
278
284
|
contextPending: !view.sessionFile && item.inherited === undefined && view.parent !== null,
|
|
279
285
|
startup: new AbortController(),
|
|
@@ -337,6 +343,11 @@ export class ThreadManager {
|
|
|
337
343
|
: parentRecord?.driver
|
|
338
344
|
? inheritContext(parentRecord.driver.snapshot())
|
|
339
345
|
: [];
|
|
346
|
+
const inheritedContextEntries = structuredClone(
|
|
347
|
+
parent === "/root"
|
|
348
|
+
? (this.options.rootContextEntries?.() ?? [])
|
|
349
|
+
: (parentRecord?.driver?.contextEntries?.() ?? []),
|
|
350
|
+
);
|
|
340
351
|
const now = Date.now();
|
|
341
352
|
const record: Record = {
|
|
342
353
|
view: {
|
|
@@ -358,6 +369,7 @@ export class ThreadManager {
|
|
|
358
369
|
},
|
|
359
370
|
definition: type,
|
|
360
371
|
inherited,
|
|
372
|
+
inheritedContextEntries,
|
|
361
373
|
contextPending: !!(parentRecord && !parentRecord.driver),
|
|
362
374
|
startup: new AbortController(),
|
|
363
375
|
pauseRequested: false,
|
|
@@ -730,6 +742,7 @@ export class ThreadManager {
|
|
|
730
742
|
canSpawnChildren,
|
|
731
743
|
type: record.definition,
|
|
732
744
|
inherited: record.inherited,
|
|
745
|
+
inheritedContextEntries: record.inheritedContextEntries,
|
|
733
746
|
tools: this.options.toolsFor(record.view.path),
|
|
734
747
|
parentPath: record.view.parent,
|
|
735
748
|
sessionFile: record.view.sessionFile,
|
|
@@ -983,6 +996,7 @@ export class ThreadManager {
|
|
|
983
996
|
if (record.contextReady) return record.contextReady;
|
|
984
997
|
if (!record.view.parent || record.view.parent === "/root") {
|
|
985
998
|
record.inherited = inheritContext(this.options.rootSnapshot());
|
|
999
|
+
record.inheritedContextEntries = structuredClone(this.options.rootContextEntries?.() ?? []);
|
|
986
1000
|
record.contextPending = false;
|
|
987
1001
|
return undefined;
|
|
988
1002
|
}
|
|
@@ -991,6 +1005,7 @@ export class ThreadManager {
|
|
|
991
1005
|
ready = this.ensureDriver(parentRecord, readOnly)
|
|
992
1006
|
.then((driver) => {
|
|
993
1007
|
record.inherited = inheritContext(driver.snapshot());
|
|
1008
|
+
record.inheritedContextEntries = structuredClone(driver.contextEntries?.() ?? []);
|
|
994
1009
|
record.contextPending = false;
|
|
995
1010
|
if (record.contextReady === ready) record.contextReady = undefined;
|
|
996
1011
|
this.touch(record);
|
package/src/orch/runtime.ts
CHANGED
|
@@ -31,6 +31,7 @@ import { TranscriptChannel } from "./transcript.ts";
|
|
|
31
31
|
import { delegationGuidance } from "./prompt.ts";
|
|
32
32
|
import { discoverSubagentExtensions, selectSubagentExtensions } from "./extensions.ts";
|
|
33
33
|
import type { InheritedToolSource } from "./inherited-tools.ts";
|
|
34
|
+
import { inheritedContextEntries } from "./context-entries.ts";
|
|
34
35
|
import type {
|
|
35
36
|
ModelSelectionMode,
|
|
36
37
|
SubagentExtensionSelection,
|
|
@@ -347,6 +348,9 @@ export function createDriverFactory(
|
|
|
347
348
|
sessionManager.appendMessage(message);
|
|
348
349
|
}
|
|
349
350
|
}
|
|
351
|
+
for (const entry of options.inheritedContextEntries ?? []) {
|
|
352
|
+
sessionManager.appendCustomEntry(entry.customType, entry.data);
|
|
353
|
+
}
|
|
350
354
|
}
|
|
351
355
|
const restored = options.sessionFile ? sessionManager.buildSessionContext() : undefined;
|
|
352
356
|
const modelSelection = getModelSelection();
|
|
@@ -979,6 +983,9 @@ export function createDriverFactory(
|
|
|
979
983
|
snapshot() {
|
|
980
984
|
return structuredClone(session.messages);
|
|
981
985
|
},
|
|
986
|
+
contextEntries() {
|
|
987
|
+
return inheritedContextEntries(sessionManager.getBranch());
|
|
988
|
+
},
|
|
982
989
|
observeTranscript(listener) {
|
|
983
990
|
assertOpen();
|
|
984
991
|
return transcript.observe(listener);
|
package/src/types.ts
CHANGED
|
@@ -140,10 +140,17 @@ export interface TranscriptObservation {
|
|
|
140
140
|
}
|
|
141
141
|
export type TranscriptListener = (snapshot: TranscriptSnapshot) => void;
|
|
142
142
|
|
|
143
|
+
/** Opaque session metadata needed to reproduce inherited context transformations. */
|
|
144
|
+
export interface InheritedContextEntry {
|
|
145
|
+
customType: string;
|
|
146
|
+
data: unknown;
|
|
147
|
+
}
|
|
148
|
+
|
|
143
149
|
export interface AgentDriver {
|
|
144
150
|
prompt(message: string): Promise<void>;
|
|
145
151
|
steer(message: string): Promise<void>;
|
|
146
152
|
snapshot(): AgentMessage[];
|
|
153
|
+
contextEntries?(): InheritedContextEntry[];
|
|
147
154
|
observeTranscript?(listener: TranscriptListener): TranscriptObservation;
|
|
148
155
|
output(): string;
|
|
149
156
|
abort(): Promise<void>;
|
|
@@ -158,6 +165,7 @@ export interface DriverOptions {
|
|
|
158
165
|
canSpawnChildren?: boolean;
|
|
159
166
|
type: AgentType;
|
|
160
167
|
inherited: AgentMessage[];
|
|
168
|
+
inheritedContextEntries?: InheritedContextEntry[];
|
|
161
169
|
tools: ToolDefinition[];
|
|
162
170
|
onEvent(event: DriverEvent): void;
|
|
163
171
|
shouldPause(): boolean;
|
|
@@ -198,6 +206,7 @@ export interface SavedThread {
|
|
|
198
206
|
definition: AgentType;
|
|
199
207
|
/** Reserved threads may not have a transcript yet; preserve their initial context. */
|
|
200
208
|
inherited?: AgentMessage[];
|
|
209
|
+
inheritedContextEntries?: InheritedContextEntry[];
|
|
201
210
|
}
|
|
202
211
|
export interface ThreadService {
|
|
203
212
|
list(): ThreadView[];
|
|
@@ -245,6 +254,7 @@ export interface ThreadActivity {
|
|
|
245
254
|
export interface ManagerOptions {
|
|
246
255
|
createDriver: DriverFactory;
|
|
247
256
|
rootSnapshot(): AgentMessage[];
|
|
257
|
+
rootContextEntries?(): InheritedContextEntry[];
|
|
248
258
|
getType(name: string): AgentType;
|
|
249
259
|
toolsFor(path: string): ToolDefinition[];
|
|
250
260
|
onEvent?(event: ThreadEvent): void;
|