Vendor ACP provider catalog

This commit is contained in:
Mohamed Boudra
2026-05-06 20:00:40 +08:00
committed by GitHub
parent ac375f152d
commit c36f4cfee4
46 changed files with 1605 additions and 28 deletions
@@ -18,7 +18,11 @@ describe("applyMutableProviderConfigToOverrides", () => {
},
},
{
gemini: { enabled: false },
gemini: {
enabled: false,
description: "Gemini ACP",
env: { GEMINI_AUTO_UPDATE: "0" },
},
claude: {
additionalModels: [
{
@@ -33,7 +37,9 @@ describe("applyMutableProviderConfigToOverrides", () => {
gemini: {
extends: "acp",
label: "Gemini",
description: "Gemini ACP",
command: ["gemini", "--acp"],
env: { GEMINI_AUTO_UPDATE: "0" },
enabled: false,
},
claude: {
@@ -137,4 +143,39 @@ describe("DaemonConfigStore", () => {
],
});
});
test("patch persists custom ACP provider overrides into config.json", () => {
const paseoHome = mkdtempSync(path.join(tmpdir(), "paseo-daemon-config-store-"));
tempDirs.push(paseoHome);
const store = new DaemonConfigStore(
paseoHome,
{
mcp: { injectIntoAgents: false },
providers: {},
},
undefined,
);
store.patch({
providers: {
"paseo-e2e-acp": {
extends: "acp",
label: "Paseo E2E ACP",
description: "E2E ACP provider fixture",
command: ["npx", "-y", "--version"],
env: {},
},
},
});
const persisted = loadPersistedConfig(paseoHome);
expect(persisted.agents?.providers?.["paseo-e2e-acp"]).toEqual({
extends: "acp",
label: "Paseo E2E ACP",
description: "E2E ACP provider fixture",
command: ["npx", "-y", "--version"],
env: {},
});
});
});
@@ -3,6 +3,7 @@ import {
savePersistedConfig,
type PersistedConfig,
} from "./persisted-config.js";
import { ProviderOverrideSchema } from "./agent/provider-launch-config.js";
import { MutableDaemonConfigSchema, MutableDaemonConfigPatchSchema } from "../shared/messages.js";
export type { MutableDaemonConfig, MutableDaemonConfigPatch } from "../shared/messages.js";
@@ -70,13 +71,8 @@ export function applyMutableProviderConfigToOverrides(
for (const [providerId, providerConfig] of Object.entries(mutableProviders ?? {})) {
nextOverrides[providerId] = {
...nextOverrides[providerId],
...ProviderOverrideSchema.strip().parse(providerConfig),
};
if (providerConfig.enabled !== undefined) {
nextOverrides[providerId].enabled = providerConfig.enabled;
}
if (providerConfig.additionalModels !== undefined) {
nextOverrides[providerId].additionalModels = providerConfig.additionalModels;
}
}
return nextOverrides;