Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

refactor(mcp-host): drop no-op deriveProbeSignal wrapper (PR #153 review nit)

Alfredo Lopez813d8f182457
diff --git a/mcp-host/src/__tests__/mcp/mcpManager.status.test.ts b/mcp-host/src/__tests__/mcp/mcpManager.status.test.ts
index 4eced747e..592ed3ab4 100644
--- a/mcp-host/src/__tests__/mcp/mcpManager.status.test.ts
+++ b/mcp-host/src/__tests__/mcp/mcpManager.status.test.ts
@@ -22,7 +22,7 @@ function connectedManager(clients: Record<string, ProbeClient>): {
}
describe('McpManager status refresh', () => {
- it('aggregates raw-probe metadata and gives every client a distinct derived signal', async () => {
+ it('aggregates raw-probe metadata and forwards the round signal to every probe', async () => {
const first = {
probeTools: vi.fn().mockResolvedValue({ ok: true, toolCount: 2, outputSchemaCount: 1 }),
}
@@ -47,9 +47,8 @@ describe('McpManager status refresh', () => {
const firstSignal = first.probeTools.mock.calls[0]?.[0].signal as AbortSignal
const secondSignal = second.probeTools.mock.calls[0]?.[0].signal as AbortSignal
- expect(firstSignal).not.toBe(controller.signal)
- expect(secondSignal).not.toBe(controller.signal)
- expect(firstSignal).not.toBe(secondSignal)
+ expect(firstSignal).toBe(controller.signal)
+ expect(secondSignal).toBe(controller.signal)
expect(tracker.get('first')?.toolCount).toBe(2)
expect(tracker.get('second')?.reason).toBe('unknown')
})
diff --git a/mcp-host/src/mcp/manager.ts b/mcp-host/src/mcp/manager.ts
index 3e5c05c15..eafa6c1fc 100644
--- a/mcp-host/src/mcp/manager.ts
+++ b/mcp-host/src/mcp/manager.ts
@@ -14,13 +14,6 @@ export interface McpStatusRefreshSummary {
aborted: boolean
}
-function deriveProbeSignal(roundSignal: AbortSignal | undefined): AbortSignal {
- const probeController = new AbortController()
- return roundSignal
- ? AbortSignal.any([roundSignal, probeController.signal])
- : probeController.signal
-}
-
export type McpAdmissionOutcome = 'applied' | 'stale'
export interface McpAdmissionControl {
isCurrent?: () => boolean
@@ -489,9 +482,12 @@ export class McpManager {
return {
name,
client,
+ // Probes share the round's abort signal directly: the heartbeat owns
+ // round-level cancellation and no per-probe cancellation capability
+ // exists, so wrapping the signal would only fake a seam.
result: await client.probeTools({
timeoutMs: options.timeoutMs,
- signal: deriveProbeSignal(options.signal),
+ signal: options.signal,
}),
}
} catch (error) {