fix(core-schemas): add missing openai-codex provider type definition#5359
Merged
chrarnoldus merged 1 commit intoKilo-Org:mainfrom Jan 25, 2026
Merged
Conversation
🦋 Changeset detectedLatest commit: e4076d9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
## Problem PR Kilo-Org#5270 (merged 2026-01-21) added openai-codex provider support but did not include the TypeScript type definition in @kilocode/core-schemas. This causes compilation errors when code attempts to handle openai-codex in switch statements: error TS2678: Type '"openai-codex"' is not comparable to type ... The provider was added to: - cli/src/constants/providers/validation.ts (runtime validation) - cli/src/constants/providers/labels.ts (UI labels) - cli/src/constants/providers/settings.ts (default settings) But missing from: - packages/core-schemas/src/config/provider.ts (TypeScript types) - cli/src/config/mapper.ts (model field mapping) ## Impact Any code using switch/case on provider.provider that includes openai-codex will fail TypeScript compilation. This blocks: - CLI providers API command (needs to map openai-codex model field) - Any future switch-based provider handling logic ## Solution This adds the missing type definition: - Created openAICodexProviderSchema with apiModelId field - Added to providerConfigSchema discriminated union (line 396) - Exported OpenAICodexProviderConfig type (line 442) - Added openai-codex mapping in CLI provider model handling (apiModelId) openai-codex now matches the pattern of openai-native (both use apiModelId). ## Verification Type checking: pnpm check-types CLI tests: cd cli && pnpm test Related: Kilo-Org#5270
a93feb3 to
e4076d9
Compare
chrarnoldus
approved these changes
Jan 25, 2026
This was referenced Jan 25, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
PR #5270 added openai-codex provider but the implementation was incomplete - it included runtime validation and UI metadata, but missed the TypeScript type definition in
@kilocode/core-schemasand model mapping incli/src/config/mapper.ts.This bug was discovered while developing the CLI providers API command (branch
feat/cli-subcommands-discoverability), which needs to enumerate and display all configured providers with their model information. When attempting to addcase "openai-codex":to the switch statement, TypeScript reported:Implementation
packages/core-schemas/src/config/provider.ts:
openAICodexProviderSchemawithapiModelIdfieldproviderConfigSchemadiscriminated union (line 398)OpenAICodexProviderConfigtype (line 444)kilocode_change(per CLAUDE.md - packages/ requires markers)cli/src/config/mapper.ts:
openai-codexcase alongsideopenai-native(both useapiModelId)openai-codex now matches the pattern of openai-native and can be properly handled in type-safe code.
Screenshots
N/A (type definition fix)
How to Test
pnpm check-types # All 20 packages should passGet in Touch
@PeterDaveHello