Skip to content

Commit ba5cc88

Browse files
committed
🤖 fix: Wire up init events to frontend WorkspaceStore
Init events were being buffered until "caught-up" but init hooks run during workspace creation, before the workspace has any history or caught-up status. Changes: - Added isInitStart, isInitOutput, isInitEnd imports to WorkspaceStore - Updated isStreamEvent() to include init events (process immediately) - Added explicit init event handling in processStreamEvent() - Init events now bypass caught-up check and process immediately This ensures the init banner appears in the UI when workspaces are created.
1 parent 4da5698 commit ba5cc88

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/stores/WorkspaceStore.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ import {
2121
isToolCallEnd,
2222
isReasoningDelta,
2323
isReasoningEnd,
24+
isInitStart,
25+
isInitOutput,
26+
isInitEnd,
2427
} from "@/types/ipc";
2528
import { MapStore } from "./MapStore";
2629
import { createDisplayUsage } from "@/utils/tokens/tokenStatsCalculator";
@@ -762,7 +765,10 @@ export class WorkspaceStore {
762765
isToolCallDelta(data) ||
763766
isToolCallEnd(data) ||
764767
isReasoningDelta(data) ||
765-
isReasoningEnd(data)
768+
isReasoningEnd(data) ||
769+
isInitStart(data) ||
770+
isInitOutput(data) ||
771+
isInitEnd(data)
766772
);
767773
}
768774

@@ -935,6 +941,13 @@ export class WorkspaceStore {
935941
return;
936942
}
937943

944+
// Handle init events (always process immediately, even if not caught up)
945+
if (isInitStart(data) || isInitOutput(data) || isInitEnd(data)) {
946+
aggregator.handleMessage(data);
947+
this.states.bump(workspaceId);
948+
return;
949+
}
950+
938951
// Regular messages (CmuxMessage without type field)
939952
const isCaughtUp = this.caughtUp.get(workspaceId) ?? false;
940953
if (!isCaughtUp) {

0 commit comments

Comments
 (0)