MCPcopy Create free account
hub / github.com/Noumena-Network/code / reconnectEnvironmentWithSession

Function reconnectEnvironmentWithSession

src/bridge/replBridge.ts:614–624  ·  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

612 * same reconnection attempt.
613 */
614 async function reconnectEnvironmentWithSession(): Promise<boolean> {
615 if (reconnectPromise) {
616 return reconnectPromise
617 }
618 reconnectPromise = doReconnect()
619 try {
620 return await reconnectPromise
621 } finally {
622 reconnectPromise = null
623 }
624 }
625
626 async function doReconnect(): Promise<boolean> {
627 environmentRecreations++

Callers 3

initBridgeCoreFunction · 0.85
onEnvironmentLostFunction · 0.85

Calls 1

doReconnectFunction · 0.85

Tested by

no test coverage detected