Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/proxy/schema/secrets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export const BaseMetadataSchema = z
excludeDefaultModels: z.boolean().nullish(),
additionalHeaders: z.record(z.string(), z.string()).nullish(),
supportsStreaming: z.boolean().default(true),
custom_model: z.string().nullish(),
custom_system_prompt: z.string().nullish(),
overrideModel: z.string().nullish(),
overrideSystemPrompt: z.string().nullish(),
Comment on lines +11 to +12

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep accepting legacy secret metadata keys

Renaming custom_model/custom_system_prompt to camelCase here introduces a breaking read path for existing secrets: BaseMetadataSchema is .strict(), so metadata objects that still contain the old keys are now rejected by APISecretSchema.parse during secret lookup (packages/proxy/edge/index.ts:244-249), which drops into the fallback branch and uses the bearer token as a provider key (packages/proxy/edge/index.ts:260-265). In environments with previously saved snake_case metadata, this can turn valid proxy credentials into provider auth failures until every stored secret is migrated.

Useful? React with 👍 / 👎.

})
.strict();

Expand Down
8 changes: 4 additions & 4 deletions packages/proxy/src/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1182,12 +1182,12 @@ async function fetchModelLoop(
const secrets = await getApiSecrets(model);

const customModelOverride =
secrets.length > 0 && secrets[0].metadata?.custom_model
? String(secrets[0].metadata.custom_model)
secrets.length > 0 && secrets[0].metadata?.overrideModel
? String(secrets[0].metadata.overrideModel)
: null;
const customSystemPromptContent =
secrets.length > 0 && secrets[0].metadata?.custom_system_prompt
? String(secrets[0].metadata.custom_system_prompt)
secrets.length > 0 && secrets[0].metadata?.overrideSystemPrompt
? String(secrets[0].metadata.overrideSystemPrompt)
: null;

if (customModelOverride) {
Expand Down