@oh-my-pi/pi-agent-core 16.1.8 → 16.1.10
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 +6 -0
- package/package.json +7 -7
- package/src/agent-loop.ts +4 -19
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [16.1.10] - 2026-06-21
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Fixed labeled user interrupts retaining incomplete streamed tool calls before `toolcall_end`, which could persist malformed tool-call IDs into replay.
|
|
10
|
+
|
|
5
11
|
## [16.1.8] - 2026-06-20
|
|
6
12
|
|
|
7
13
|
### Breaking Changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/pi-agent-core",
|
|
4
|
-
"version": "16.1.
|
|
4
|
+
"version": "16.1.10",
|
|
5
5
|
"description": "General-purpose agent with transport abstraction, state management, and attachment support",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"fmt": "biome format --write ."
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@oh-my-pi/pi-ai": "16.1.
|
|
39
|
-
"@oh-my-pi/pi-catalog": "16.1.
|
|
40
|
-
"@oh-my-pi/pi-natives": "16.1.
|
|
41
|
-
"@oh-my-pi/pi-utils": "16.1.
|
|
42
|
-
"@oh-my-pi/pi-wire": "16.1.
|
|
43
|
-
"@oh-my-pi/snapcompact": "16.1.
|
|
38
|
+
"@oh-my-pi/pi-ai": "16.1.10",
|
|
39
|
+
"@oh-my-pi/pi-catalog": "16.1.10",
|
|
40
|
+
"@oh-my-pi/pi-natives": "16.1.10",
|
|
41
|
+
"@oh-my-pi/pi-utils": "16.1.10",
|
|
42
|
+
"@oh-my-pi/pi-wire": "16.1.10",
|
|
43
|
+
"@oh-my-pi/snapcompact": "16.1.10",
|
|
44
44
|
"@opentelemetry/api": "^1.9.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
package/src/agent-loop.ts
CHANGED
|
@@ -1539,20 +1539,6 @@ export function abortReasonText(signal: AbortSignal | undefined): string {
|
|
|
1539
1539
|
return "Request was aborted";
|
|
1540
1540
|
}
|
|
1541
1541
|
|
|
1542
|
-
/** True when an abort carried a *deliberate*, human-meaningful reason — a string
|
|
1543
|
-
* reason or a non-`AbortError` `Error` (TTSR rule match, user-interrupt label).
|
|
1544
|
-
* A bare `abort()` (default `AbortError` `DOMException`) is anonymous and returns
|
|
1545
|
-
* false. Used to decide whether a mid-stream tool call survives the abort: a
|
|
1546
|
-
* deliberate interruption is a conscious decision made after the (partial) call
|
|
1547
|
-
* was observed, so the block is retained and paired with a labeled placeholder;
|
|
1548
|
-
* an anonymous abort drops incomplete calls whose args may be unsafe to replay. */
|
|
1549
|
-
function isExplicitAbortReason(signal: AbortSignal | undefined): boolean {
|
|
1550
|
-
const reason = signal?.reason;
|
|
1551
|
-
if (typeof reason === "string") return reason.trim().length > 0;
|
|
1552
|
-
if (reason instanceof Error) return reason.name !== "AbortError" && reason.message.trim().length > 0;
|
|
1553
|
-
return false;
|
|
1554
|
-
}
|
|
1555
|
-
|
|
1556
1542
|
function emitAbortedAssistantMessage(
|
|
1557
1543
|
partialMessage: AssistantMessage | null,
|
|
1558
1544
|
addedPartial: boolean,
|
|
@@ -1583,11 +1569,10 @@ function emitAbortedAssistantMessage(
|
|
|
1583
1569
|
errorMessage,
|
|
1584
1570
|
timestamp: Date.now(),
|
|
1585
1571
|
};
|
|
1586
|
-
//
|
|
1587
|
-
//
|
|
1588
|
-
//
|
|
1589
|
-
|
|
1590
|
-
const retained = isExplicitAbortReason(requestSignal) ? base : retainCompletedToolCalls(base, completedToolCallIds);
|
|
1572
|
+
// Only tool calls that reached `toolcall_end` survive abort/error replay. A
|
|
1573
|
+
// labeled user interrupt still surfaces through `errorMessage`, but partial
|
|
1574
|
+
// tool arguments are unsafe to keep and can carry incomplete provider IDs.
|
|
1575
|
+
const retained = retainCompletedToolCalls(base, completedToolCallIds);
|
|
1591
1576
|
const abortedMessage = snapshotAssistantMessage(retained);
|
|
1592
1577
|
if (addedPartial) {
|
|
1593
1578
|
context.messages[context.messages.length - 1] = abortedMessage;
|