@oh-my-pi/pi-agent-core 16.2.3 → 16.2.4

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,18 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [16.2.4] - 2026-06-28
6
+
7
+ ### Changed
8
+
9
+ - Improved the reliability of remote compaction by introducing transient error retries, configurable timeouts, and immediate termination upon user-initiated aborts.
10
+
11
+ ### Fixed
12
+
13
+ - Fixed an issue where assistant responses and encrypted reasoning could be lost during local history trimming prior to remote compaction.
14
+ - Fixed type compatibility for hosts with title audit entries by adding support for `title_change` session metadata.
15
+ - Fixed an issue where transient stream read failures after a completed tool call were treated as terminal errors, allowing the agent to successfully execute the tool and continue the turn.
16
+
5
17
  ## [16.2.3] - 2026-06-28
6
18
 
7
19
  ### Changed
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.2.3",
4
+ "version": "16.2.4",
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.2.3",
39
- "@oh-my-pi/pi-catalog": "16.2.3",
40
- "@oh-my-pi/pi-natives": "16.2.3",
41
- "@oh-my-pi/pi-utils": "16.2.3",
42
- "@oh-my-pi/pi-wire": "16.2.3",
43
- "@oh-my-pi/snapcompact": "16.2.3",
38
+ "@oh-my-pi/pi-ai": "16.2.4",
39
+ "@oh-my-pi/pi-catalog": "16.2.4",
40
+ "@oh-my-pi/pi-natives": "16.2.4",
41
+ "@oh-my-pi/pi-utils": "16.2.4",
42
+ "@oh-my-pi/pi-wire": "16.2.4",
43
+ "@oh-my-pi/snapcompact": "16.2.4",
44
44
  "@opentelemetry/api": "^1.9.1"
45
45
  },
46
46
  "devDependencies": {
package/src/agent-loop.ts CHANGED
@@ -1355,7 +1355,10 @@ async function streamAssistantResponse(
1355
1355
 
1356
1356
  const event = next.value;
1357
1357
  if (event.type === "done" || event.type === "error") {
1358
- let finalMessage = retainCompletedToolCalls(await response.result(), completedToolCallIds);
1358
+ let finalMessage = recoverTransientErrorToolTurn(
1359
+ retainCompletedToolCalls(await response.result(), completedToolCallIds),
1360
+ context.tools ?? [],
1361
+ );
1359
1362
  if (harmonyMitigationEnabled) {
1360
1363
  const detection = detectHarmonyLeakInAssistantMessage(finalMessage);
1361
1364
  if (detection) {
@@ -1515,8 +1518,40 @@ function retainCompletedToolCalls(
1515
1518
  : {
1516
1519
  type: STREAM_INTERRUPTED_AFTER_CONTENT_STOP_DETAIL,
1517
1520
  category: message.stopDetails?.type ?? null,
1518
- explanation: message.stopDetails?.explanation ?? null,
1521
+ explanation: message.stopDetails?.explanation ?? message.errorMessage ?? null,
1522
+ },
1523
+ };
1524
+ }
1525
+
1526
+ function recoverTransientErrorToolTurn(
1527
+ message: AssistantMessage,
1528
+ availableTools: ReadonlyArray<Pick<AgentTool, "name" | "customWireName">>,
1529
+ ): AssistantMessage {
1530
+ if (message.stopReason !== "error") return message;
1531
+ const toolCalls = message.content.filter(block => block.type === "toolCall");
1532
+ if (toolCalls.length === 0) return message;
1533
+ const availableToolNames = new Set<string>();
1534
+ for (const tool of availableTools) {
1535
+ availableToolNames.add(tool.name);
1536
+ if (tool.customWireName !== undefined) availableToolNames.add(tool.customWireName);
1537
+ }
1538
+ if (!toolCalls.every(toolCall => availableToolNames.has(toolCall.name))) return message;
1539
+ if (!AIError.isStreamReadErrorText(`${message.errorMessage ?? ""}\n${message.stopDetails?.explanation ?? ""}`))
1540
+ return message;
1541
+ return {
1542
+ ...message,
1543
+ stopReason: "toolUse",
1544
+ stopDetails:
1545
+ message.stopDetails?.type === STREAM_INTERRUPTED_AFTER_CONTENT_STOP_DETAIL
1546
+ ? message.stopDetails
1547
+ : {
1548
+ type: STREAM_INTERRUPTED_AFTER_CONTENT_STOP_DETAIL,
1549
+ category: message.stopDetails?.type ?? null,
1550
+ explanation: message.stopDetails?.explanation ?? message.errorMessage ?? null,
1519
1551
  },
1552
+ errorMessage: undefined,
1553
+ errorId: undefined,
1554
+ errorStatus: undefined,
1520
1555
  };
1521
1556
  }
1522
1557