pi-cohort 5.1.2 → 5.1.3
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,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [5.1.3] - 2026-08-18
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- Foreground control notices are steered to a turn boundary while the session
|
|
8
|
+
is streaming instead of splicing into an open tool cycle (which corrupted
|
|
9
|
+
the session with a duplicated `tool_use_id`); idle delivery still appends
|
|
10
|
+
without triggering a turn. (#7)
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- `dir` no longer advertised by the subagent tool schema (follows `runId`,
|
|
15
|
+
#5) - still accepted at runtime for async status/resume, `id` preferred.
|
|
16
|
+
|
|
3
17
|
## [5.1.2] - 2026-08-07
|
|
4
18
|
|
|
5
19
|
### Changed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-cohort",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.3",
|
|
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",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"scripts": {
|
|
37
37
|
"check:agents-core": "node scripts/check-agents-core.mjs",
|
|
38
38
|
"test": "npm run test:unit",
|
|
39
|
-
"test:unit": "node --
|
|
40
|
-
"test:integration": "node --
|
|
39
|
+
"test:unit": "node --test test/unit/*.test.ts",
|
|
40
|
+
"test:integration": "node --import ./test/support/register-loader.mjs --test test/integration/*.test.ts",
|
|
41
41
|
"test:all": "npm run check:agents-core && npm run test:unit && npm run test:integration"
|
|
42
42
|
},
|
|
43
43
|
"pi": {
|
|
@@ -39,6 +39,7 @@ function deliverControlNotice(input: {
|
|
|
39
39
|
pi: Pick<ExtensionAPI, "sendMessage">;
|
|
40
40
|
visibleControlNotices: Set<string>;
|
|
41
41
|
details: SubagentControlMessageDetails;
|
|
42
|
+
isIdle: () => boolean;
|
|
42
43
|
}): void {
|
|
43
44
|
const childIntercomTarget = controlNoticeTarget(input.details);
|
|
44
45
|
const key = controlNotificationKey(input.details.event, childIntercomTarget);
|
|
@@ -52,7 +53,7 @@ function deliverControlNotice(input: {
|
|
|
52
53
|
display: true,
|
|
53
54
|
details: { ...input.details, childIntercomTarget, noticeText },
|
|
54
55
|
},
|
|
55
|
-
{ triggerTurn: input.details.source !== "foreground" },
|
|
56
|
+
{ triggerTurn: input.details.source !== "foreground" || !input.isIdle() },
|
|
56
57
|
);
|
|
57
58
|
}
|
|
58
59
|
|
|
@@ -72,8 +73,9 @@ export function handleSubagentControlNotice(input: {
|
|
|
72
73
|
foregroundDelayMs?: number;
|
|
73
74
|
}): void {
|
|
74
75
|
if (!input.details?.event || input.details.event.type === "active_long_running") return;
|
|
76
|
+
const isIdle = () => input.state.lastUiContext?.isIdle() ?? false;
|
|
75
77
|
if (input.details.source !== "foreground") {
|
|
76
|
-
deliverControlNotice(input);
|
|
78
|
+
deliverControlNotice({ ...input, isIdle });
|
|
77
79
|
return;
|
|
78
80
|
}
|
|
79
81
|
|
|
@@ -85,7 +87,7 @@ export function handleSubagentControlNotice(input: {
|
|
|
85
87
|
const timer = setTimeout(() => {
|
|
86
88
|
pending.delete(timerKey);
|
|
87
89
|
if (!isForegroundNoticeStillActionable(input.state, input.details)) return;
|
|
88
|
-
deliverControlNotice(input);
|
|
90
|
+
deliverControlNotice({ ...input, isIdle });
|
|
89
91
|
}, input.foregroundDelayMs ?? 1000);
|
|
90
92
|
timer.unref?.();
|
|
91
93
|
pending.set(timerKey, timer);
|
package/src/extension/index.ts
CHANGED
|
@@ -183,10 +183,13 @@ function parseSubagentNotifyContent(content: string): SubagentNotifyDetails | un
|
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
class SubagentControlNoticeComponent implements Component {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
) {
|
|
186
|
+
private readonly details: SubagentControlMessageDetails;
|
|
187
|
+
private readonly theme: ExtensionContext["ui"]["theme"];
|
|
188
|
+
|
|
189
|
+
constructor(details: SubagentControlMessageDetails, theme: ExtensionContext["ui"]["theme"]) {
|
|
190
|
+
this.details = details;
|
|
191
|
+
this.theme = theme;
|
|
192
|
+
}
|
|
190
193
|
|
|
191
194
|
invalidate(): void {}
|
|
192
195
|
|
package/src/extension/schemas.ts
CHANGED
|
@@ -259,9 +259,6 @@ export const SubagentParams = Type.Object({
|
|
|
259
259
|
id: Type.Optional(Type.String({
|
|
260
260
|
description: "Run id/prefix for status/interrupt/resume."
|
|
261
261
|
})),
|
|
262
|
-
dir: Type.Optional(Type.String({
|
|
263
|
-
description: "Async run dir for status/resume."
|
|
264
|
-
})),
|
|
265
262
|
index: Type.Optional(Type.Integer({ minimum: 0, description: "Zero-based index for per-child actions." })),
|
|
266
263
|
message: Type.Optional(Type.String({ description: "Follow-up message for resume." })),
|
|
267
264
|
// Chain identifier for management (can't reuse 'chain' — that's the execution array)
|