mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-10 12:37:55 +01:00
Fix nested adapter config mediation
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
3e8c37a82e
commit
bc3a17b109
5 files changed
+344
-53
No files matched your search
@@ -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",
|
||||
|
||||
Reference in new issue
Block a user