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
5 changes: 5 additions & 0 deletions .changeset/fix-openai-codex-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kilocode/core-schemas": patch
---

Add missing openai-codex provider type definition
1 change: 1 addition & 0 deletions cli/src/config/mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export function getModelIdForProvider(provider: ProviderConfig): string {
case "anthropic":
return provider.apiModelId || ""
case "openai-native":
case "openai-codex":
return provider.apiModelId || ""
case "openrouter":
return provider.openRouterModelId || ""
Expand Down
14 changes: 14 additions & 0 deletions cli/src/config/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@
"kilocode",
"anthropic",
"openai-native",
"openai-codex",
"openrouter",
"bedrock",
"gemini",
Expand Down Expand Up @@ -443,6 +444,19 @@
}
}
},
{
"if": {
"properties": { "provider": { "const": "openai-codex" } }
},
"then": {
"properties": {
"apiModelId": {
"type": "string",
"description": "OpenAI model ID"
}
}
}
},
{
"if": {
"properties": { "provider": { "const": "openrouter" } }
Expand Down
10 changes: 10 additions & 0 deletions packages/core-schemas/src/config/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ export const openAINativeProviderSchema = baseProviderSchema.extend({
openAiNativeServiceTier: z.enum(["auto", "default", "flex", "priority"]).optional(),
})

// kilocode_change start
// OpenAI Codex provider (ChatGPT Plus/Pro)
export const openAICodexProviderSchema = baseProviderSchema.extend({
provider: z.literal("openai-codex"),
apiModelId: z.string().optional(),
})
// kilocode_change end

// OpenAI provider
export const openAIProviderSchema = baseProviderSchema.extend({
provider: z.literal("openai"),
Expand Down Expand Up @@ -387,6 +395,7 @@ export const providerConfigSchema = z.discriminatedUnion("provider", [
kilocodeProviderSchema,
anthropicProviderSchema,
openAINativeProviderSchema,
openAICodexProviderSchema, // kilocode_change
openAIProviderSchema,
openRouterProviderSchema,
ollamaProviderSchema,
Expand Down Expand Up @@ -432,6 +441,7 @@ export const providerConfigSchema = z.discriminatedUnion("provider", [
export type KilocodeProviderConfig = z.infer<typeof kilocodeProviderSchema>
export type AnthropicProviderConfig = z.infer<typeof anthropicProviderSchema>
export type OpenAINativeProviderConfig = z.infer<typeof openAINativeProviderSchema>
export type OpenAICodexProviderConfig = z.infer<typeof openAICodexProviderSchema> // kilocode_change
export type OpenAIProviderConfig = z.infer<typeof openAIProviderSchema>
export type OpenRouterProviderConfig = z.infer<typeof openRouterProviderSchema>
export type OllamaProviderConfig = z.infer<typeof ollamaProviderSchema>
Expand Down