Skip to content

Commit 9fdfe23

Browse files
marthakellyclaude
andcommitted
refactor(core): export ɵMAX_SOCKET_RETRIES for thread-store tests
Tests in @copilotkit/react-core need the WebSocket retry budget so they can validate teardown semantics without hardcoding the threshold separately from production. Exposing it under the ɵ-prefixed internal namespace keeps it out of the public API surface while letting the test bench import a single source of truth. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 7421bf1 commit 9fdfe23

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

packages/core/src/threads.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ import {
2525
ofType,
2626
on,
2727
props,
28-
type Store,
2928
} from "./utils/micro-redux";
29+
import type { Store } from "./utils/micro-redux";
3030
import {
3131
ɵphoenixChannel$,
3232
ɵphoenixSocket$,
33-
type ɵPhoenixChannelSession,
3433
ɵobservePhoenixEvent$,
3534
ɵobservePhoenixJoinOutcome$,
3635
ɵobservePhoenixSocketHealth$,
3736
ɵobservePhoenixSocketSignals$,
3837
} from "./utils/phoenix-observable";
38+
import type { ɵPhoenixChannelSession } from "./utils/phoenix-observable";
3939

4040
const THREADS_CHANNEL_EVENT = "thread_metadata";
4141
const THREAD_SUBSCRIBE_PATH = "/threads/subscribe";
@@ -1019,3 +1019,10 @@ export const ɵselectThreadsError = selectThreadsError;
10191019
export const ɵselectHasNextPage = selectHasNextPage;
10201020
export const ɵselectIsFetchingNextPage = selectIsFetchingNextPage;
10211021
export { createThreadStore as ɵcreateThreadStore };
1022+
/**
1023+
* Number of consecutive WebSocket connection failures after which the
1024+
* threads channel tears itself down rather than retrying indefinitely.
1025+
* Exposed for tests so they can assert teardown semantics without
1026+
* hardcoding the threshold separately from production.
1027+
*/
1028+
export const ɵMAX_SOCKET_RETRIES = MAX_SOCKET_RETRIES;

0 commit comments

Comments
 (0)