@omercnet/paseo-omp 3.0.0-next.278.2 → 3.0.0-next.280.1
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/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Release Please keeps this bundle-safe constant aligned with package.json. */
|
|
2
|
-
export const PASEO_OMP_PACKAGE_VERSION = "3.0.0-next.
|
|
2
|
+
export const PASEO_OMP_PACKAGE_VERSION = "3.0.0-next.280.1"; // x-release-please-version
|
|
@@ -71,6 +71,7 @@ const CHUNK_STALE_MS = 30_000;
|
|
|
71
71
|
const MAX_PHYSICAL_FRAME_BYTES = 1024 * 1024;
|
|
72
72
|
const MAX_STREAM_TEXT_LENGTH = 4 * 1024 * 1024;
|
|
73
73
|
const MAX_ACTIVE_TOOLS = 64;
|
|
74
|
+
const MAX_ENDED_TOOL_IDS = 1_024;
|
|
74
75
|
const MAX_PENDING_REQUESTS = 256;
|
|
75
76
|
const MAX_PENDING_ONE_WAY_WRITES = 256;
|
|
76
77
|
const MAX_PENDING_WRITE_BYTES = 8 * 1024 * 1024;
|
|
@@ -164,6 +165,9 @@ export class OmpRpcProcess {
|
|
|
164
165
|
private readonly streamedBlocks = new Map<number, string>();
|
|
165
166
|
private readonly activeToolCallIds = new Set<string>();
|
|
166
167
|
private readonly announcedToolCallIds = new Set<string>();
|
|
168
|
+
// Detached background tools keep streaming updates after they return and after turn_end.
|
|
169
|
+
// FIFO-capped: an update for an id evicted after MAX_ENDED_TOOL_IDS later calls is flagged again.
|
|
170
|
+
private readonly endedToolCallIds = new Set<string>();
|
|
167
171
|
private pendingWriteBytes = 0;
|
|
168
172
|
private commandTextLength = 0;
|
|
169
173
|
private lineParts: Buffer[] = [];
|
|
@@ -1081,6 +1085,8 @@ export class OmpRpcProcess {
|
|
|
1081
1085
|
});
|
|
1082
1086
|
return;
|
|
1083
1087
|
}
|
|
1088
|
+
// Emitted once the session has no live or background work. Nothing consumes it yet.
|
|
1089
|
+
if (type === "session_settled") return;
|
|
1084
1090
|
if (type === "ready") {
|
|
1085
1091
|
if (this.readyReceived) {
|
|
1086
1092
|
this.recordProtocolViolation("duplicate-ready", {
|
|
@@ -1121,6 +1127,12 @@ export class OmpRpcProcess {
|
|
|
1121
1127
|
});
|
|
1122
1128
|
return;
|
|
1123
1129
|
}
|
|
1130
|
+
if (
|
|
1131
|
+
event.data.type === "tool_execution_update" &&
|
|
1132
|
+
this.endedToolCallIds.has(event.data.toolCallId)
|
|
1133
|
+
) {
|
|
1134
|
+
return;
|
|
1135
|
+
}
|
|
1124
1136
|
if (!this.acceptEventState(event.data)) {
|
|
1125
1137
|
this.recordProtocolViolation("invalid-event-state", {
|
|
1126
1138
|
reason: "event-state-transition",
|
|
@@ -1188,6 +1200,7 @@ export class OmpRpcProcess {
|
|
|
1188
1200
|
return false;
|
|
1189
1201
|
}
|
|
1190
1202
|
this.activeToolCallIds.add(event.toolCallId);
|
|
1203
|
+
this.endedToolCallIds.delete(event.toolCallId);
|
|
1191
1204
|
return true;
|
|
1192
1205
|
}
|
|
1193
1206
|
if (event.type === "tool_stream_update") {
|
|
@@ -1203,6 +1216,11 @@ export class OmpRpcProcess {
|
|
|
1203
1216
|
if (!this.activeToolCallIds.has(event.toolCallId)) return false;
|
|
1204
1217
|
this.activeToolCallIds.delete(event.toolCallId);
|
|
1205
1218
|
this.announcedToolCallIds.delete(event.toolCallId);
|
|
1219
|
+
if (this.endedToolCallIds.size >= MAX_ENDED_TOOL_IDS) {
|
|
1220
|
+
const oldest = this.endedToolCallIds.values().next().value;
|
|
1221
|
+
if (oldest !== undefined) this.endedToolCallIds.delete(oldest);
|
|
1222
|
+
}
|
|
1223
|
+
this.endedToolCallIds.add(event.toolCallId);
|
|
1206
1224
|
return true;
|
|
1207
1225
|
}
|
|
1208
1226
|
if (
|