Skip to content

Commit ade536c

Browse files
Merge pull request #1516 from corbitsdev/cl-10829-stop-the-openai-responses-import-from-constructing-the
perf(permission): defer the grok responses import off reactor boot
2 parents 0f353ac + ac289c1 commit ade536c

2 files changed

Lines changed: 27 additions & 3 deletions

File tree

‎src/session/runtime-core-import.test.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,13 @@ test(
6262
},
6363
{ timeout: 60_000 },
6464
);
65+
66+
test(
67+
"importing reactor-authorize does not evaluate inference-events",
68+
() => {
69+
const result = importUnderProbe("./src/permission/reactor-authorize.ts");
70+
expect(result.stderr).not.toContain("evaluated-inference-events");
71+
expect(result.status).toBe(0);
72+
},
73+
{ timeout: 60_000 },
74+
);

‎src/subagent/provider-family.ts‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
1-
import { GROK_RESPONSES_PROVIDER } from "../provider/grok-responses.js";
2-
import { isXaiProviderName } from "../config/xai-providers.js";
3-
import { isCodexProviderName } from "../config/codex-providers.js";
41
import { isDeepSeekModel } from "../provider/deepseek-v4-effort.js";
52

3+
/** Wire id for the Grok Responses adapter. Duplicated in grok-responses.ts so
4+
* this module does not load @corbits/openai-responses at reactor boot. */
5+
const GROK_RESPONSES_PROVIDER = "grok-responses";
6+
7+
/** Prefixes owned by config/xai-providers.ts and config/codex-providers.ts.
8+
* Inlined so a name check does not evaluate those modules' provider barrels. */
9+
const XAI_PROVIDER_PREFIX = "xai/";
10+
const CODEX_PROVIDER_PREFIX = "codex/";
11+
12+
function isXaiProviderName(name: string): boolean {
13+
return name.startsWith(XAI_PROVIDER_PREFIX);
14+
}
15+
16+
function isCodexProviderName(name: string): boolean {
17+
return name.startsWith(CODEX_PROVIDER_PREFIX);
18+
}
19+
620
/** True when the leaf inference path is xAI / Grok. For small prompt
721
* residuals only. */
822
export function isXaiGrokLeafProvider(input: {

0 commit comments

Comments
 (0)