@hienlh/ppm 0.9.35 → 0.9.37
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
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.9.36] - 2026-04-06
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- **Stream timeout during tool execution**: Per-event timeout increased from 60s to 180s. Tool calls (bash, file writes, memory saves) frequently exceed 60s between events, causing premature stream termination.
|
|
7
|
+
|
|
3
8
|
## [0.9.35] - 2026-04-06
|
|
4
9
|
|
|
5
10
|
### Fixed
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
|
|
9
9
|
const MAX_MSG_LEN = 4096;
|
|
10
10
|
const TYPING_REFRESH_MS = 4000;
|
|
11
|
-
const EVENT_TIMEOUT_MS =
|
|
11
|
+
const EVENT_TIMEOUT_MS = 180_000; // 3 min max wait per event (tool execution can be slow)
|
|
12
12
|
const PLACEHOLDER = "\u2026"; // ellipsis
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -29,7 +29,7 @@ async function* withEventTimeout<T>(
|
|
|
29
29
|
),
|
|
30
30
|
]);
|
|
31
31
|
if ("timedOut" in result) {
|
|
32
|
-
throw new Error("No response within
|
|
32
|
+
throw new Error("No response within 3 minutes");
|
|
33
33
|
}
|
|
34
34
|
if (result.done) break;
|
|
35
35
|
yield result.value;
|
|
@@ -149,8 +149,14 @@ export async function streamToTelegram(
|
|
|
149
149
|
};
|
|
150
150
|
|
|
151
151
|
// Process event stream with per-event timeout
|
|
152
|
+
let eventCount = 0;
|
|
152
153
|
try {
|
|
153
154
|
for await (const event of withEventTimeout(events, EVENT_TIMEOUT_MS)) {
|
|
155
|
+
eventCount++;
|
|
156
|
+
// Debug: log each event type to help diagnose streaming issues
|
|
157
|
+
if (event.type !== "text") {
|
|
158
|
+
console.log(`[ppmbot-stream] event #${eventCount}: ${event.type}${event.type === "tool_use" ? ` (${(event as any).tool})` : ""}`);
|
|
159
|
+
}
|
|
154
160
|
await refreshTyping();
|
|
155
161
|
|
|
156
162
|
switch (event.type) {
|
|
@@ -223,12 +229,15 @@ export async function streamToTelegram(
|
|
|
223
229
|
}
|
|
224
230
|
}
|
|
225
231
|
} catch (err) {
|
|
232
|
+
console.error(`[ppmbot-stream] Stream ended with error after ${eventCount} events: ${(err as Error).message}`);
|
|
226
233
|
appendHtml(
|
|
227
234
|
segments,
|
|
228
235
|
`\n\n❌ <b>Stream error:</b> ${escapeHtml((err as Error).message)}`,
|
|
229
236
|
);
|
|
230
237
|
}
|
|
231
238
|
|
|
239
|
+
console.log(`[ppmbot-stream] Complete: ${eventCount} events, ${segments.length} segments`);
|
|
240
|
+
|
|
232
241
|
// Final edit with complete content
|
|
233
242
|
if (currentMsgId && hasContent(segments)) {
|
|
234
243
|
const html = renderSegments(segments);
|