feat(plugins): warn on ignored setup runtime (#71253)

* feat(plugins): warn on ignored setup runtime

* fix(plugins): avoid fallback setup runtime diagnostics

* refactor(plugins): clarify setup runtime lookup
This commit is contained in:
Vincent Koc
2026-04-24 14:23:19 -07:00
committed by GitHub
parent 6e985a421d
commit 5b8bd6371c
4 changed files with 87 additions and 5 deletions

View File

@@ -373,6 +373,42 @@ describe("setup-registry getJiti", () => {
expect(resolvePluginSetupProvider({ provider: "openai", env: {} })).toBeUndefined();
expect(resolvePluginSetupCliBackend({ backend: "codex-cli", env: {} })).toBeUndefined();
expect(resolvePluginSetupRegistry({ env: {} })).toEqual({
providers: [],
cliBackends: [],
configMigrations: [],
autoEnableProbes: [],
diagnostics: [
expect.objectContaining({
pluginId: "openai",
code: "setup-descriptor-runtime-disabled",
}),
],
});
expect(mocks.createJiti).not.toHaveBeenCalled();
});
it("does not report descriptor-only diagnostics for bundled setup-api fallback paths", () => {
const parentDir = makeTempDir();
const pluginRoot = path.join(parentDir, "openai");
fs.mkdirSync(pluginRoot);
expect(fs.existsSync(path.join(process.cwd(), "extensions", "openai", "setup-api.ts"))).toBe(
true,
);
mocks.loadPluginManifestRegistry.mockReturnValue({
plugins: [
{
id: "workspace-openai",
rootDir: pluginRoot,
setup: {
providers: [{ id: "workspace-openai" }],
requiresRuntime: false,
},
},
],
diagnostics: [],
});
expect(resolvePluginSetupRegistry({ env: {} })).toEqual({
providers: [],
cliBackends: [],