tycono 0.3.6 → 0.3.8
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
|
@@ -317,8 +317,10 @@ export const App: React.FC = () => {
|
|
|
317
317
|
}));
|
|
318
318
|
|
|
319
319
|
const allWaves = [...pastEntries, ...apiWaves];
|
|
320
|
+
allWaves.sort((a, b) => a.startedAt - b.startedAt);
|
|
320
321
|
setWaves(allWaves);
|
|
321
|
-
|
|
322
|
+
// Focus most recent wave
|
|
323
|
+
setFocusedWaveId(allWaves[allWaves.length - 1]?.waveId ?? null);
|
|
322
324
|
autoWaveCreated.current = true;
|
|
323
325
|
} else if (api.loaded && api.pastWaves.length > 0) {
|
|
324
326
|
// No active waves, past waves exist — resume last wave (don't create new)
|
|
@@ -335,11 +337,7 @@ export const App: React.FC = () => {
|
|
|
335
337
|
const lastWave = pastEntries[pastEntries.length - 1];
|
|
336
338
|
setFocusedWaveId(lastWave?.waveId ?? null);
|
|
337
339
|
|
|
338
|
-
//
|
|
339
|
-
if (lastWave) {
|
|
340
|
-
loadPreviousConversation(lastWave.waveId);
|
|
341
|
-
loadWaveHistoryEvents(lastWave.waveId);
|
|
342
|
-
}
|
|
340
|
+
// SSE replay handles history display automatically (persistent channel model)
|
|
343
341
|
} else if (api.loaded) {
|
|
344
342
|
// No active waves, no past waves — fresh start
|
|
345
343
|
autoWaveCreated.current = true;
|
|
@@ -442,8 +440,7 @@ export const App: React.FC = () => {
|
|
|
442
440
|
setFocusedWaveId(waveId);
|
|
443
441
|
sse.clearEvents();
|
|
444
442
|
setSystemMessages([]);
|
|
445
|
-
|
|
446
|
-
loadWaveHistoryEvents(waveId);
|
|
443
|
+
// SSE reconnect handles history replay automatically
|
|
447
444
|
},
|
|
448
445
|
onQuit: () => exit(),
|
|
449
446
|
onShowPanel: () => setMode('panel'),
|
|
@@ -690,8 +687,6 @@ export const App: React.FC = () => {
|
|
|
690
687
|
setFocusedWaveId(newWaveId);
|
|
691
688
|
sse.clearEvents();
|
|
692
689
|
setSystemMessages([]);
|
|
693
|
-
loadPreviousConversation(newWaveId);
|
|
694
|
-
loadWaveHistoryEvents(newWaveId);
|
|
695
690
|
}}
|
|
696
691
|
/>
|
|
697
692
|
</Box>
|