@llblab/pi-actors 0.26.2 → 0.26.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 +5 -0
- package/dist/lib/tools.js +24 -1
- package/dist/skills/actors/SKILL.md +1 -1
- package/dist/skills/swarm/SKILL.md +1 -1
- package/lib/tools.ts +22 -1
- package/package.json +1 -1
- package/skills/actors/SKILL.md +1 -1
- package/skills/swarm/SKILL.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.26.3: Branch Message Delivery UX Hotfix
|
|
6
|
+
|
|
7
|
+
- `[Actor Messages]` Treat branch mailbox persistence as a successful queued outcome even when the parent run control endpoint is unavailable, returning compact `queued=true` delivery diagnostics instead of throwing an unframed tool error.
|
|
8
|
+
- `[UX]` Preserve the compact action-output contract for branch `message` calls by keeping delivery diagnostics in the normal result formatter, including the leading blank-line separation used by other tool actions.
|
|
9
|
+
|
|
5
10
|
## 0.26.2: Terminal Progress Hotfix
|
|
6
11
|
|
|
7
12
|
- `[Async Runs]` Keep `progress.json` aligned with terminal kill/cancel handling by writing `phase=killed` or `phase=cancelled` and clearing active subagent counts when a run is stopped by runtime control.
|
package/dist/lib/tools.js
CHANGED
|
@@ -441,6 +441,8 @@ function compactActorMessageResult(message, result) {
|
|
|
441
441
|
];
|
|
442
442
|
if (result.bytes !== undefined)
|
|
443
443
|
tokens.push(`bytes=${String(result.bytes)}`);
|
|
444
|
+
if (result.queued === true)
|
|
445
|
+
tokens.push("queued=true");
|
|
444
446
|
if (result.control)
|
|
445
447
|
tokens.push(`control=${String(result.control)}`);
|
|
446
448
|
if (result.outbox)
|
|
@@ -459,6 +461,9 @@ function compactActorMessageResult(message, result) {
|
|
|
459
461
|
tokens.push(`signal=${String(result.signal)}`);
|
|
460
462
|
if (result.invoked === true)
|
|
461
463
|
tokens.push("invoked=true");
|
|
464
|
+
if (result.delivery_error) {
|
|
465
|
+
tokens.push(`delivery_error=${compactPreview(result.delivery_error, 96)}`);
|
|
466
|
+
}
|
|
462
467
|
return `\n${tokens.join(" ")}`;
|
|
463
468
|
}
|
|
464
469
|
function maybeJsonText(value, verbose, compact) {
|
|
@@ -543,7 +548,25 @@ function assertMessageSenderBelongsToRun(message, run, routeLabel) {
|
|
|
543
548
|
async function routeBranchEnvelope(stateDir, runId, recipient, message, _options) {
|
|
544
549
|
const branchMessage = { ...message, to: recipient };
|
|
545
550
|
ActorRooms.appendBranchInboxMessage(stateDir, runId, recipient, branchMessage);
|
|
546
|
-
|
|
551
|
+
try {
|
|
552
|
+
return await AsyncRuns.sendRunMessage(runId, JSON.stringify(branchMessage));
|
|
553
|
+
}
|
|
554
|
+
catch (error) {
|
|
555
|
+
const record = error && typeof error === "object" ? error : {};
|
|
556
|
+
if (record.queued === true) {
|
|
557
|
+
return {
|
|
558
|
+
control_path: record.control_path,
|
|
559
|
+
control_type: record.control_type,
|
|
560
|
+
delivery_error: record.delivery_error ?? (error instanceof Error ? error.message : String(error)),
|
|
561
|
+
inbox_id: record.inbox_id,
|
|
562
|
+
queued: true,
|
|
563
|
+
run: runId,
|
|
564
|
+
sent: false,
|
|
565
|
+
state_dir: stateDir,
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
throw error;
|
|
569
|
+
}
|
|
547
570
|
}
|
|
548
571
|
function getRoomMulticastRecipients(message, run) {
|
|
549
572
|
const raw = message.metadata?.recipients;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: actors
|
|
3
3
|
description: Highest-density practical guide for pi-actors. Read this skill whenever prompt and tools are not enough for spawn, message, inspect, actor runs, tools, recipes, command templates, async lifecycle, mailboxes, artifacts, and local orchestration mechanics.
|
|
4
4
|
metadata:
|
|
5
|
-
version: 0.26.
|
|
5
|
+
version: 0.26.3
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Actors (pi-actors)
|
package/lib/tools.ts
CHANGED
|
@@ -535,6 +535,7 @@ function compactActorMessageResult(
|
|
|
535
535
|
`message=${result.sent === true || result.stopped === true ? "sent" : "not_sent"}`,
|
|
536
536
|
];
|
|
537
537
|
if (result.bytes !== undefined) tokens.push(`bytes=${String(result.bytes)}`);
|
|
538
|
+
if (result.queued === true) tokens.push("queued=true");
|
|
538
539
|
if (result.control) tokens.push(`control=${String(result.control)}`);
|
|
539
540
|
if (result.outbox) tokens.push(`messages=${String(result.outbox)}`);
|
|
540
541
|
if (result.message_count !== undefined)
|
|
@@ -546,6 +547,9 @@ function compactActorMessageResult(
|
|
|
546
547
|
if (result.stopped === true) tokens.push("stopped=true");
|
|
547
548
|
if (result.signal) tokens.push(`signal=${String(result.signal)}`);
|
|
548
549
|
if (result.invoked === true) tokens.push("invoked=true");
|
|
550
|
+
if (result.delivery_error) {
|
|
551
|
+
tokens.push(`delivery_error=${compactPreview(result.delivery_error, 96)}`);
|
|
552
|
+
}
|
|
549
553
|
return `\n${tokens.join(" ")}`;
|
|
550
554
|
}
|
|
551
555
|
|
|
@@ -695,7 +699,24 @@ async function routeBranchEnvelope(
|
|
|
695
699
|
recipient,
|
|
696
700
|
branchMessage,
|
|
697
701
|
);
|
|
698
|
-
|
|
702
|
+
try {
|
|
703
|
+
return await AsyncRuns.sendRunMessage(runId, JSON.stringify(branchMessage));
|
|
704
|
+
} catch (error) {
|
|
705
|
+
const record = error && typeof error === "object" ? (error as Record<string, unknown>) : {};
|
|
706
|
+
if (record.queued === true) {
|
|
707
|
+
return {
|
|
708
|
+
control_path: record.control_path,
|
|
709
|
+
control_type: record.control_type,
|
|
710
|
+
delivery_error: record.delivery_error ?? (error instanceof Error ? error.message : String(error)),
|
|
711
|
+
inbox_id: record.inbox_id,
|
|
712
|
+
queued: true,
|
|
713
|
+
run: runId,
|
|
714
|
+
sent: false,
|
|
715
|
+
state_dir: stateDir,
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
throw error;
|
|
719
|
+
}
|
|
699
720
|
}
|
|
700
721
|
|
|
701
722
|
function getRoomMulticastRecipients(
|
package/package.json
CHANGED
package/skills/actors/SKILL.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: actors
|
|
3
3
|
description: Highest-density practical guide for pi-actors. Read this skill whenever prompt and tools are not enough for spawn, message, inspect, actor runs, tools, recipes, command templates, async lifecycle, mailboxes, artifacts, and local orchestration mechanics.
|
|
4
4
|
metadata:
|
|
5
|
-
version: 0.26.
|
|
5
|
+
version: 0.26.3
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Actors (pi-actors)
|
package/skills/swarm/SKILL.md
CHANGED