tycono 0.1.105 → 0.1.106
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
|
@@ -299,18 +299,21 @@ export const CommandMode: React.FC<CommandModeProps> = ({
|
|
|
299
299
|
}
|
|
300
300
|
|
|
301
301
|
// Merge user inputs + system messages + event lines (cap total)
|
|
302
|
-
const allLines = [...userInputs, ...systemMessages, ...eventLines].slice(-
|
|
302
|
+
const allLines = [...userInputs, ...systemMessages, ...eventLines].slice(-60);
|
|
303
303
|
|
|
304
|
-
//
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
const toCommit = newCommitted.slice(0, -6);
|
|
308
|
-
committedRef.current += toCommit.length;
|
|
304
|
+
// Reset committedRef if it exceeds allLines (prevents unbounded growth)
|
|
305
|
+
if (committedRef.current > allLines.length) {
|
|
306
|
+
committedRef.current = Math.max(0, allLines.length - 6);
|
|
309
307
|
}
|
|
310
308
|
|
|
311
|
-
//
|
|
312
|
-
const
|
|
313
|
-
|
|
309
|
+
// Commit older lines to Static scrollback, keep last 6 as live
|
|
310
|
+
const newCount = allLines.length - committedRef.current;
|
|
311
|
+
if (newCount > 6) {
|
|
312
|
+
committedRef.current = allLines.length - 6;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// Only send last 20 committed items to Static (prevent Ink memory growth)
|
|
316
|
+
const committedLines = allLines.slice(Math.max(0, committedRef.current - 20), committedRef.current);
|
|
314
317
|
const liveLines = allLines.slice(committedRef.current);
|
|
315
318
|
|
|
316
319
|
// Quick bar navigation
|
package/src/tui/hooks/useSSE.ts
CHANGED
|
@@ -118,7 +118,10 @@ export function useSSE(waveId: string | null): SSEState {
|
|
|
118
118
|
reconnectAttemptRef.current = 0;
|
|
119
119
|
|
|
120
120
|
// Add to batch buffer (don't trigger React re-render yet)
|
|
121
|
-
|
|
121
|
+
// Cap batch to prevent unbounded growth if flush is delayed
|
|
122
|
+
if (batchRef.current.length < 50) {
|
|
123
|
+
batchRef.current.push(trimEvent(event));
|
|
124
|
+
}
|
|
122
125
|
|
|
123
126
|
// Schedule flush if not already scheduled
|
|
124
127
|
if (!batchTimerRef.current) {
|