Repository navigation
Description
Context
The public-export cut (docs/decisions/public-export-boundary.md) removed ui-react's default-root wrappers from its public entry, and the decision lists them as removed. The wrapper functions themselves were left in src, and most now have no caller at all:
| name | defined at | importers |
|---|---|---|
sendClientMessage |
packages/ui-react/src/hooks/use-websocket.ts:10 |
none |
reconnectWebSocketNow |
packages/ui-react/src/hooks/use-websocket.ts:11 |
none |
recheckVpnStatus |
packages/ui-react/src/hooks/use-vpn-status.ts:50 |
none |
loadSessionActivityHistory, loadSpanPayloads |
packages/ui-react/src/stores/activity-store.ts:13-14 |
none (the same names elsewhere are store methods, not these bindings) |
getWsUrl, getBackendUrl |
packages/ui-react/src/lib/backend.ts:45-46 |
none; root.ts:6 and the tests use the …For(config) variants |
handleServerMessage, flushChatDeltas |
packages/ui-react/src/hooks/use-websocket.ts:8-9 |
tests only (10 files, e.g. packages/ui-react/tests/delta-batching.test.ts:7, tests/session-demux.test.ts:4, tests/render/streaming-bench.tsx:62) |
Each wrapper forwards to the module-level defaultRoot, so the tests that use handleServerMessage/flushChatDeltas drive the default root through a back door instead of root.connection.*, which is what the app uses.
Five more ui-react exports are used only in their own file (selectBackendForProvider, normalizeDirPath, isUnconfirmed, CountBadge, ViewerError). #2536 owns dropping their export along with its unused-export gate; they are not part of this issue.
git grep -nE "import[^;]*\b(sendClientMessage|reconnectWebSocketNow|recheckVpnStatus|loadSessionActivityHistory|loadSpanPayloads|getWsUrl|getBackendUrl)\b[^;]*from" -- packages tests scripts # nothing
git grep -nE "import[^;]*\b(handleServerMessage|flushChatDeltas)\b[^;]*use-websocket" -- packages tests scripts # tests onlyScope
- Delete the nine wrappers listed in the table.
- Point the tests that import
handleServerMessage/flushChatDeltasat a root they create (or the default root'sconnection), astests/root-isolation.test.tsalready does. - Update
docs/decisions/public-export-boundary.mdanddocs/decisions/design-kit/state-architecture.mdif they name a deleted function as existing.
Out of scope
- The default root itself and
useWebSocket/useVpnStatushooks. - Test-only logic in
srcthat is not a default-root wrapper (ToolCallTimeline,inlineRenderedFencesand similar; tracked separately). - The five own-file exports and the gate for unused exports (ci: no gate catches an export that no other file imports #2536).
Acceptance criteria
- None of the nine wrapper names is defined in
packages/ui-react/src. - No test imports from
src/hooks/use-websocketanything other thanuseWebSocketandrunStateForFrame. - The tests that used the wrappers still pass, and each still fails when the frame handling it covers is broken. Record one mutation per converted file group in the PR, for example dropping delta batching for
delta-batching.test.ts. -
bun run typecheckandbun run test packages/ui-reactpass;api-report/ui-react.txtis unchanged (none of these names is public).
Verification
bun run test packages/ui-react
bun run typecheck
bun run test tests/api-surface.test.tsContract impact
None. None of the names is exported from a ui-react entry point.
Found by a repository review on 2026-10-22.
2026-10-24: moved the five own-file export removals to #2536, which now owns them; this issue keeps wrapper deletion and the test conversion to root-owned connections.
Activity
schlessera commentedon Nov 3, 2026
Claiming (token
claim-2535-d2d0). Branchchore/2535-default-root-wrappers, targeting the epic integration branchepic/2542-dead-code. Collision check: PR #3368 also touchesdocs/decisions/public-export-boundary.md; other reports are dependency-closure only.schlessera commentedon Nov 3, 2026
PR #3411 (base
epic/2542-dead-code@ac3cab77a, head85fe98a65) deletes all nine wrappers. The test importers now calldefaultRoot.connection, with one mutation receipt per file group. The api-report is unchanged and local preflight passed. The PR is ready; hosted proof is pending. This issue closes when the epic batch lands on main.chore(ui-react): delete default-root wrappers left by the export cut (#…
schlessera commentedon Nov 3, 2026
Delivered to
epic/2542-dead-codeas9df9192f3via #3411, after ready-candidate proof passed on the exact epic base. This issue closes when the epic batch lands on main.