@oh-my-pi/pi-agent-core 15.10.1 → 15.10.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 +6 -0
- package/dist/types/proxy.d.ts +1 -2
- package/package.json +4 -4
- package/src/proxy.ts +8 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [15.10.2] - 2026-06-08
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Fixed proxy stream silently returning a zero-token success response when the server disconnects without sending a `done` or `error` terminal SSE event. The stream now throws an error, surfacing the disconnect as an `error` event with `stopReason: "error"` and resolving `finalResultPromise`, instead of defaulting to `stopReason: "stop"` with empty content and leaving `stream.result()` callers hanging indefinitely.
|
|
10
|
+
|
|
5
11
|
## [15.10.1] - 2026-06-07
|
|
6
12
|
|
|
7
13
|
### Added
|
package/dist/types/proxy.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* The server manages auth and proxies requests to LLM providers.
|
|
4
4
|
*/
|
|
5
5
|
import { type AssistantMessage, type AssistantMessageEvent, type Context, EventStream, type Model, type SimpleStreamOptions, type StopReason } from "@oh-my-pi/pi-ai";
|
|
6
|
-
declare class ProxyMessageEventStream extends EventStream<AssistantMessageEvent, AssistantMessage> {
|
|
6
|
+
export declare class ProxyMessageEventStream extends EventStream<AssistantMessageEvent, AssistantMessage> {
|
|
7
7
|
constructor();
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
@@ -81,4 +81,3 @@ export interface ProxyStreamOptions extends SimpleStreamOptions {
|
|
|
81
81
|
* ```
|
|
82
82
|
*/
|
|
83
83
|
export declare function streamProxy(model: Model, context: Context, options: ProxyStreamOptions): ProxyMessageEventStream;
|
|
84
|
-
export {};
|
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": "15.10.
|
|
4
|
+
"version": "15.10.2",
|
|
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,9 +35,9 @@
|
|
|
35
35
|
"fmt": "biome format --write ."
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@oh-my-pi/pi-ai": "15.10.
|
|
39
|
-
"@oh-my-pi/pi-natives": "15.10.
|
|
40
|
-
"@oh-my-pi/pi-utils": "15.10.
|
|
38
|
+
"@oh-my-pi/pi-ai": "15.10.2",
|
|
39
|
+
"@oh-my-pi/pi-natives": "15.10.2",
|
|
40
|
+
"@oh-my-pi/pi-utils": "15.10.2",
|
|
41
41
|
"@opentelemetry/api": "^1.9.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
package/src/proxy.ts
CHANGED
|
@@ -16,8 +16,8 @@ import { calculateCost } from "@oh-my-pi/pi-ai/models";
|
|
|
16
16
|
import { parseStreamingJson } from "@oh-my-pi/pi-ai/utils/json-parse";
|
|
17
17
|
import { readSseJson } from "@oh-my-pi/pi-utils";
|
|
18
18
|
|
|
19
|
-
//
|
|
20
|
-
class ProxyMessageEventStream extends EventStream<AssistantMessageEvent, AssistantMessage> {
|
|
19
|
+
// Event stream adapter for proxy SSE events
|
|
20
|
+
export class ProxyMessageEventStream extends EventStream<AssistantMessageEvent, AssistantMessage> {
|
|
21
21
|
constructor() {
|
|
22
22
|
super(
|
|
23
23
|
event => event.type === "done" || event.type === "error",
|
|
@@ -167,9 +167,12 @@ export function streamProxy(model: Model, context: Context, options: ProxyStream
|
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
if (
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
if (!sawTerminalEvent) {
|
|
171
|
+
if (options.signal?.aborted) {
|
|
172
|
+
const reason = options.signal.reason;
|
|
173
|
+
throw reason instanceof Error ? reason : new Error(String(reason ?? "Request aborted"));
|
|
174
|
+
}
|
|
175
|
+
throw new Error("Proxy stream ended without a terminal event (done or error)");
|
|
173
176
|
}
|
|
174
177
|
|
|
175
178
|
stream.end();
|