tycono 0.3.5 → 0.3.7
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 +1 -1
- package/src/api/src/routes/execute.ts +7 -5
- package/src/tui/app.tsx +5 -10
package/package.json
CHANGED
|
@@ -50,14 +50,16 @@ export function handleExecRequest(req: IncomingMessage, res: ServerResponse): vo
|
|
|
50
50
|
|
|
51
51
|
// ── /api/waves/active — restore active waves after refresh ──
|
|
52
52
|
if (method === 'GET' && url === '/api/waves/active') {
|
|
53
|
-
// Recovery: rebuild wave→session mapping from session-store
|
|
54
|
-
//
|
|
53
|
+
// Recovery: rebuild wave→session mapping from session-store
|
|
54
|
+
// Include done sessions (persistent channel model) but limit to CEO sessions
|
|
55
55
|
const waves = waveMultiplexer.getActiveWaves();
|
|
56
56
|
if (waves.length === 0) {
|
|
57
57
|
const allSessions = listSessions();
|
|
58
58
|
let recovered = 0;
|
|
59
59
|
for (const ses of allSessions) {
|
|
60
|
-
if (!ses.waveId
|
|
60
|
+
if (!ses.waveId) continue;
|
|
61
|
+
// Only recover CEO sessions for wave display (team sessions loaded on demand)
|
|
62
|
+
if (ses.roleId !== 'ceo') continue;
|
|
61
63
|
const exec = executionManager.getActiveExecution(ses.id);
|
|
62
64
|
if (exec) {
|
|
63
65
|
waveMultiplexer.registerSession(ses.waveId, exec);
|
|
@@ -476,10 +478,10 @@ function handleWaveStream(waveId: string, url: string, res: ServerResponse, req:
|
|
|
476
478
|
|
|
477
479
|
let sessionIds = waveMultiplexer.getWaveSessionIds(waveId);
|
|
478
480
|
|
|
479
|
-
// Recovery:
|
|
481
|
+
// Recovery: recover sessions for this wave (active + done = persistent channel)
|
|
480
482
|
if (sessionIds.length === 0) {
|
|
481
483
|
const allSessions = listSessions();
|
|
482
|
-
const waveSessions = allSessions.filter(s => s.waveId === waveId
|
|
484
|
+
const waveSessions = allSessions.filter(s => s.waveId === waveId);
|
|
483
485
|
for (const ses of waveSessions) {
|
|
484
486
|
const exec = executionManager.getActiveExecution(ses.id);
|
|
485
487
|
if (exec) {
|
package/src/tui/app.tsx
CHANGED
|
@@ -335,11 +335,7 @@ export const App: React.FC = () => {
|
|
|
335
335
|
const lastWave = pastEntries[pastEntries.length - 1];
|
|
336
336
|
setFocusedWaveId(lastWave?.waveId ?? null);
|
|
337
337
|
|
|
338
|
-
//
|
|
339
|
-
if (lastWave) {
|
|
340
|
-
loadPreviousConversation(lastWave.waveId);
|
|
341
|
-
loadWaveHistoryEvents(lastWave.waveId);
|
|
342
|
-
}
|
|
338
|
+
// SSE replay handles history display automatically (persistent channel model)
|
|
343
339
|
} else if (api.loaded) {
|
|
344
340
|
// No active waves, no past waves — fresh start
|
|
345
341
|
autoWaveCreated.current = true;
|
|
@@ -363,9 +359,11 @@ export const App: React.FC = () => {
|
|
|
363
359
|
// Load wave history into SSE events (for Panel Mode Stream tab)
|
|
364
360
|
const historyLoadingRef = useRef<string | null>(null);
|
|
365
361
|
const loadWaveHistoryEvents = useCallback(async (waveId: string) => {
|
|
366
|
-
// Guard: skip if already loading this wave
|
|
362
|
+
// Guard: skip if already loading this wave
|
|
367
363
|
if (historyLoadingRef.current === waveId) return;
|
|
368
364
|
historyLoadingRef.current = waveId;
|
|
365
|
+
// Wait for SSE reconnection to settle (it calls setEvents([]) on connect)
|
|
366
|
+
await new Promise(r => setTimeout(r, 500));
|
|
369
367
|
|
|
370
368
|
try {
|
|
371
369
|
const sessions = api.sessions.filter(s => s.waveId === waveId && s.roleId === 'ceo');
|
|
@@ -440,8 +438,7 @@ export const App: React.FC = () => {
|
|
|
440
438
|
setFocusedWaveId(waveId);
|
|
441
439
|
sse.clearEvents();
|
|
442
440
|
setSystemMessages([]);
|
|
443
|
-
|
|
444
|
-
loadWaveHistoryEvents(waveId);
|
|
441
|
+
// SSE reconnect handles history replay automatically
|
|
445
442
|
},
|
|
446
443
|
onQuit: () => exit(),
|
|
447
444
|
onShowPanel: () => setMode('panel'),
|
|
@@ -688,8 +685,6 @@ export const App: React.FC = () => {
|
|
|
688
685
|
setFocusedWaveId(newWaveId);
|
|
689
686
|
sse.clearEvents();
|
|
690
687
|
setSystemMessages([]);
|
|
691
|
-
loadPreviousConversation(newWaveId);
|
|
692
|
-
loadWaveHistoryEvents(newWaveId);
|
|
693
688
|
}}
|
|
694
689
|
/>
|
|
695
690
|
</Box>
|