Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(chatService): cover plan_review_decided forwarding

Steven Enamakele734d21ec9a7
diff --git a/app/src/services/__tests__/chatService.test.ts b/app/src/services/__tests__/chatService.test.ts
index 7e75fd3410..92e5718eeb 100644
--- a/app/src/services/__tests__/chatService.test.ts
+++ b/app/src/services/__tests__/chatService.test.ts
@@ -98,6 +98,22 @@ describe('chatService.subscribeChatEvents', () => {
expect(onInferenceHeartbeat).toHaveBeenCalledWith(beat);
});
+ it('forwards plan_review_decided to clear the pending review surface', () => {
+ const socket = createMockSocket();
+ bindMockSocket(socket);
+ const onPlanReviewDecided = vi.fn();
+ subscribeChatEvents({ onPlanReviewDecided });
+
+ const event = {
+ thread_id: 'thread-plan',
+ request_id: 'review-1',
+ decision: 'reject',
+ cancel_reason: 'cancelled',
+ };
+ socket.emit('plan_review_decided', event);
+ expect(onPlanReviewDecided).toHaveBeenCalledWith(event);
+ });
+
it('does not process alias events when only canonical subscriptions are active', () => {
const socket = createMockSocket();
bindMockSocket(socket);