diff --git a/src/session/runtime-core-import.test.ts b/src/session/runtime-core-import.test.ts index c6d195782..05a0b747b 100644 --- a/src/session/runtime-core-import.test.ts +++ b/src/session/runtime-core-import.test.ts @@ -62,3 +62,13 @@ test( }, { timeout: 60_000 }, ); + +test( + "importing reactor-authorize does not evaluate inference-events", + () => { + const result = importUnderProbe("./src/permission/reactor-authorize.ts"); + expect(result.stderr).not.toContain("evaluated-inference-events"); + expect(result.status).toBe(0); + }, + { timeout: 60_000 }, +); diff --git a/src/subagent/provider-family.ts b/src/subagent/provider-family.ts index 7fa687215..0f30a49e2 100644 --- a/src/subagent/provider-family.ts +++ b/src/subagent/provider-family.ts @@ -1,8 +1,22 @@ -import { GROK_RESPONSES_PROVIDER } from "../provider/grok-responses.js"; -import { isXaiProviderName } from "../config/xai-providers.js"; -import { isCodexProviderName } from "../config/codex-providers.js"; import { isDeepSeekModel } from "../provider/deepseek-v4-effort.js"; +/** Wire id for the Grok Responses adapter. Duplicated in grok-responses.ts so + * this module does not load @corbits/openai-responses at reactor boot. */ +const GROK_RESPONSES_PROVIDER = "grok-responses"; + +/** Prefixes owned by config/xai-providers.ts and config/codex-providers.ts. + * Inlined so a name check does not evaluate those modules' provider barrels. */ +const XAI_PROVIDER_PREFIX = "xai/"; +const CODEX_PROVIDER_PREFIX = "codex/"; + +function isXaiProviderName(name: string): boolean { + return name.startsWith(XAI_PROVIDER_PREFIX); +} + +function isCodexProviderName(name: string): boolean { + return name.startsWith(CODEX_PROVIDER_PREFIX); +} + /** True when the leaf inference path is xAI / Grok. For small prompt * residuals only. */ export function isXaiGrokLeafProvider(input: {