Skip to content

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

fix(chat): restore missing test files for runtime provider and store

Steven Enamakeld9adf3177fd2
diff --git a/app/src/providers/__tests__/ChatRuntimeProvider.test.tsx b/app/src/providers/__tests__/ChatRuntimeProvider.test.tsx
index 9588e7ca0b..27ffca67a1 100644
--- a/app/src/providers/__tests__/ChatRuntimeProvider.test.tsx
+++ b/app/src/providers/__tests__/ChatRuntimeProvider.test.tsx
@@ -11,7 +11,6 @@ import {
clearAllChatRuntime,
enqueueFollowup,
findPendingDelegationContext,
- registerParallelRequest,
resetSessionTokenUsage,
setPendingPlanReviewForThread,
} from '../../store/chatRuntimeSlice';
@@ -366,85 +365,6 @@ describe('ChatRuntimeProvider — dedupe, proactive resolution, mid-turn invaria
expect(row?.subagent?.transcript).toEqual([]);
});
- it('routes a parallel (forked) turn into its own lane, leaving the primary stream untouched', () => {
- const listeners = renderProvider();
-
- // Primary turn streams on the thread.
- act(() => {
- listeners.onTextDelta?.({
- thread_id: 't-par',
- request_id: 'primary',
- round: 0,
- delta: 'P',
- });
- });
- // A parallel turn is registered and streams concurrently on the SAME thread.
- act(() => {
- store.dispatch(registerParallelRequest({ threadId: 't-par', requestId: 'branch' }));
- listeners.onTextDelta?.({
- thread_id: 't-par',
- request_id: 'branch',
- round: 0,
- delta: 'B1',
- });
- listeners.onTextDelta?.({
- thread_id: 't-par',
- request_id: 'branch',
- round: 0,
- delta: 'B2',
- });
- });
-
- const mid = store.getState().chatRuntime;
- // Primary stream is not clobbered by the parallel branch.
- expect(mid.streamingAssistantByThread['t-par']?.content).toBe('P');
- expect(mid.parallelStreamsByThread['t-par']?.['branch']?.content).toBe('B1B2');
-
- // The parallel turn's chat_done resolves ONLY its lane; the primary
- // stream and its (still-running) state survive.
- act(() => {
- listeners.onDone?.({
- thread_id: 't-par',
- request_id: 'branch',
- full_response: 'branch done',
- rounds_used: 1,
- total_input_tokens: 0,
- total_output_tokens: 0,
- segment_total: 0,
- });
- });
-
- const after = store.getState().chatRuntime;
- expect(after.parallelStreamsByThread['t-par']).toBeUndefined();
- expect(after.parallelRequestThreads['branch']).toBeUndefined();
- expect(after.streamingAssistantByThread['t-par']?.content).toBe('P');
- });
-
- it('bumps the heartbeat counter only for the primary turn, never a parallel branch (#4282)', () => {
- const listeners = renderProvider();
-
- // Primary turn's heartbeat advances the thread's liveness counter.
- act(() => {
- listeners.onInferenceHeartbeat?.({ thread_id: 't-par', request_id: 'primary' });
- });
- expect(store.getState().chatRuntime.inferenceHeartbeatByThread['t-par']).toBe(1);
-
- // A registered parallel branch's heartbeat must NOT rearm the primary
- // silence timer — otherwise a sibling would mask a stalled primary turn.
- act(() => {
- store.dispatch(registerParallelRequest({ threadId: 't-par', requestId: 'branch' }));
- listeners.onInferenceHeartbeat?.({ thread_id: 't-par', request_id: 'branch' });
- listeners.onInferenceHeartbeat?.({ thread_id: 't-par', request_id: 'branch' });
- });
- expect(store.getState().chatRuntime.inferenceHeartbeatByThread['t-par']).toBe(1);
-
- // The primary turn keeps beating independently.
- act(() => {
- listeners.onInferenceHeartbeat?.({ thread_id: 't-par', request_id: 'primary' });
- });
- expect(store.getState().chatRuntime.inferenceHeartbeatByThread['t-par']).toBe(2);
- });
-
it('drops duplicate chat_done events with the same thread/request', async () => {
const listeners = renderProvider();
diff --git a/app/src/store/__tests__/chatRuntimeSlice.test.ts b/app/src/store/__tests__/chatRuntimeSlice.test.ts
index 1fcd996a8e..a96b520ca3 100644
--- a/app/src/store/__tests__/chatRuntimeSlice.test.ts
+++ b/app/src/store/__tests__/chatRuntimeSlice.test.ts
@@ -986,23 +986,7 @@ describe('chatRuntimeSlice', () => {
});
});
- describe('parallel (forked) turn lane', () => {
- it('registers a parallel request and streams into its own lane keyed by requestId', () => {
- let state = reducer(
- undefined,
- registerParallelRequest({ threadId: 't-1', requestId: 'req-a' })
- );
- expect(state.parallelRequestThreads['req-a']).toBe('t-1');
-
- state = reducer(
- state,
- setParallelStream({
- threadId: 't-1',
- streaming: { requestId: 'req-a', content: 'hi', thinking: '' },
- })
- );
- expect(state.parallelStreamsByThread['t-1']['req-a'].content).toBe('hi');
- });
+});
it('keeps two concurrent same-thread branches separate', () => {
let state = reducer(undefined, registerParallelRequest({ threadId: 't-1', requestId: 'r1' }));