MCPcopy Create free account
hub / github.com/EvoMap/evolver / _proxyHealthyIfExpected

Function _proxyHealthyIfExpected

src/adapters/scripts/evolver-session-start.js:176–189  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

174}
175
176function _proxyHealthyIfExpected() {
177 if (!_proxyExpected()) return true;
178 const dir = process.env.EVOLVER_SETTINGS_DIR || path.join(os.homedir(), '.evolver');
179 const settings = _readJson(path.join(dir, 'settings.json'));
180 const proxy = settings && settings.proxy;
181 if (!proxy || !proxy.url) return false;
182 if (proxy.pid) {
183 try { process.kill(proxy.pid, 0); } catch (e) {
184 if (!(e && e.code === 'EPERM')) return false;
185 }
186 }
187 if (!proxy.token) return false;
188 return _proxyReachable(proxy.url, proxy.token);
189}
190
191// Auto-restart guard: if the evolver daemon is not running when a new agent
192// session starts, attempt a background restart. This covers the "idle-death"

Callers 2

_maybeRestartDaemonFunction · 0.85

Calls 3

_proxyExpectedFunction · 0.85
_readJsonFunction · 0.85
_proxyReachableFunction · 0.85

Tested by

no test coverage detected