@hienlh/ppm 0.9.36 → 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/package.json
CHANGED
|
@@ -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);
|