@oh-my-pi/pi-agent-core 14.6.0 → 14.6.2

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
+ ## [14.6.2] - 2026-05-03
6
+
7
+ ### Fixed
8
+
9
+ - Fixed unhandled promise rejection when `getApiKey` or any other async error occurs during `streamAssistantResponse`: agent loop IIFEs now catch and route errors through `EventStream.fail()`, which terminates the `for await` loop and lets `Agent#runLoop`'s catch block create a proper error assistant message instead of crashing
10
+
5
11
  ## [14.6.0] - 2026-05-02
6
12
  ### Fixed
7
13
 
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": "14.6.0",
4
+ "version": "14.6.2",
5
5
  "description": "General-purpose agent with transport abstraction, state management, and attachment support",
6
6
  "homepage": "https://github.com/can1357/oh-my-pi",
7
7
  "author": "Can Boluk",
@@ -35,9 +35,9 @@
35
35
  "fmt": "biome format --write ."
36
36
  },
37
37
  "dependencies": {
38
- "@oh-my-pi/pi-ai": "14.6.0",
39
- "@oh-my-pi/pi-natives": "14.6.0",
40
- "@oh-my-pi/pi-utils": "14.6.0"
38
+ "@oh-my-pi/pi-ai": "14.6.2",
39
+ "@oh-my-pi/pi-natives": "14.6.2",
40
+ "@oh-my-pi/pi-utils": "14.6.2"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@sinclair/typebox": "^0.34.49",
package/src/agent-loop.ts CHANGED
@@ -49,7 +49,11 @@ export function agentLoop(
49
49
  stream.push({ type: "message_end", message: prompt });
50
50
  }
51
51
 
52
- await runLoop(currentContext, newMessages, config, signal, stream, streamFn);
52
+ try {
53
+ await runLoop(currentContext, newMessages, config, signal, stream, streamFn);
54
+ } catch (err) {
55
+ stream.fail(err);
56
+ }
53
57
  })();
54
58
 
55
59
  return stream;
@@ -86,7 +90,11 @@ export function agentLoopContinue(
86
90
  stream.push({ type: "agent_start" });
87
91
  stream.push({ type: "turn_start" });
88
92
 
89
- await runLoop(currentContext, newMessages, config, signal, stream, streamFn);
93
+ try {
94
+ await runLoop(currentContext, newMessages, config, signal, stream, streamFn);
95
+ } catch (err) {
96
+ stream.fail(err);
97
+ }
90
98
  })();
91
99
 
92
100
  return stream;