Fix nested adapter config mediation

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-04-30 14:22:03 -05:00
1 parent 3e8c37a82e
commit bc3a17b109
5 files changed
+344 -53

No files matched your search

+1 -1
View File
@@ -54,7 +54,7 @@ export const createAgentInstructionsBundleSchema = z.object({
const agentModelProfileConfigSchema = z.object({
enabled: z.boolean().optional(),
label: z.string().trim().min(1).optional(),
adapterConfig: z.record(z.unknown()),
adapterConfig: adapterConfigSchema,
}).strict();
export const agentRuntimeConfigSchema = z.object({
@@ -140,6 +140,26 @@ describe("issue validators", () => {
expect(parsed.runtimeConfig.heartbeat).toEqual({ enabled: true });
});
it("validates cheap model profile env bindings like top-level adapter config", () => {
const parsed = createAgentSchema.safeParse({
name: "Coder",
adapterType: "codex_local",
runtimeConfig: {
modelProfiles: {
cheap: {
adapterConfig: {
env: {
API_TOKEN: 123,
},
},
},
},
},
});
expect(parsed.success).toBe(false);
});
it("rejects unknown agent runtime model profile keys", () => {
const parsed = createAgentSchema.safeParse({
name: "Coder",