@oh-my-pi/pi-agent-core 16.1.9 → 16.1.11

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
@@ -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.9",
4
+ "version": "16.1.11",
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.9",
39
- "@oh-my-pi/pi-catalog": "16.1.9",
40
- "@oh-my-pi/pi-natives": "16.1.9",
41
- "@oh-my-pi/pi-utils": "16.1.9",
42
- "@oh-my-pi/pi-wire": "16.1.9",
43
- "@oh-my-pi/snapcompact": "16.1.9",
38
+ "@oh-my-pi/pi-ai": "16.1.11",
39
+ "@oh-my-pi/pi-catalog": "16.1.11",
40
+ "@oh-my-pi/pi-natives": "16.1.11",
41
+ "@oh-my-pi/pi-utils": "16.1.11",
42
+ "@oh-my-pi/pi-wire": "16.1.11",
43
+ "@oh-my-pi/snapcompact": "16.1.11",
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
- // A deliberate, labeled abort (TTSR rule match, user interrupt) keeps every
1587
- // committed tool-call block so the loop pairs it with a placeholder labeled by
1588
- // `errorMessage`; an anonymous abort still drops calls that never completed
1589
- // (no `toolcall_end`), whose partial args are unsafe to replay.
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;