MCPcopy Index your code
hub / github.com/codeaashu/claude-code / reconnectEnvironmentWithSession

Function reconnectEnvironmentWithSession

src/bridge/replBridge.ts:605–615  ·  view source on GitHub ↗

* Recover from onEnvironmentLost (poll returned 404 — env was reaped * server-side). Tries two strategies in order: * * 1. Reconnect-in-place: idempotent re-register with reuseEnvironmentId * → if the backend returns the same env ID, call reconnectSession() * to re-queue t

()

Source from the content-addressed store, hash-verified

603 * same reconnection attempt.
604 */
605 async function reconnectEnvironmentWithSession(): Promise<boolean> {
606 if (reconnectPromise) {
607 return reconnectPromise
608 }
609 reconnectPromise = doReconnect()
610 try {
611 return await reconnectPromise
612 } finally {
613 reconnectPromise = null
614 }
615 }
616
617 async function doReconnect(): Promise<boolean> {
618 environmentRecreations++

Callers 3

initBridgeCoreFunction · 0.85
onEnvironmentLostFunction · 0.85

Calls 1

doReconnectFunction · 0.85

Tested by

no test coverage detected