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

Method _getHubMailboxStatus

src/proxy/index.js:1356–1378  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1354 }
1355
1356 async _getHubMailboxStatus() {
1357 if (!this.hubUrl) return { error: 'Hub not configured' };
1358 const nodeId = this.lifecycle.nodeId;
1359 if (!nodeId) return { error: 'No node_id yet' };
1360 const endpoint = `${this.hubUrl}/a2a/mailbox/status?node_id=${encodeURIComponent(nodeId)}`;
1361 try {
1362 const res = await hubFetch(endpoint, {
1363 method: 'GET',
1364 headers: this.lifecycle._buildHeaders(),
1365 signal: AbortSignal.timeout(10_000),
1366 });
1367 if (!res.ok) {
1368 // Drain body so undici can recycle the socket back to the pool.
1369 // Without this, repeated non-ok responses leak pool slots and
1370 // eventually starve the dispatcher.
1371 try { res.body?.cancel?.().catch(() => {}); } catch {}
1372 return { error: `Hub ${res.status}` };
1373 }
1374 return res.json();
1375 } catch (err) {
1376 return { error: err.message };
1377 }
1378 }
1379}
1380
1381async function startProxy(opts = {}) {

Callers 2

startMethod · 0.95

Calls 2

_buildHeadersMethod · 0.80
cancelMethod · 0.80

Tested by

no test coverage detected