[WRONG BRANCH] fix(config): validate provider modelInputModalities maps as string-array records - #223
[WRONG BRANCH] fix(config): validate provider modelInputModalities maps as string-array records#223luvs01 wants to merge 1 commit into
modelInputModalities maps as string-array records#223Conversation
|
Warning Review limit reached
Next review available in: 40 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Comment |
|
✅ Deterministic PR hygiene checks passed. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1cd9f4cdad
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for (const [key, entry] of Object.entries(value)) { | ||
| if (!key.trim()) return `${field} keys must be nonblank model ids`; | ||
| if (!Array.isArray(entry) || entry.some(item => typeof item !== "string")) { | ||
| return `${field}.${key} must be an array of strings`; |
There was a problem hiding this comment.
Redact model IDs before constructing validation errors
When a malformed persisted map uses a secret-shaped model key, such as {"sk-...": null}, this message embeds that key verbatim; loadConfig() then passes the Zod issue to warnAndBackupInvalidConfig(), which prints the full message to stderr. The management validation path likewise returns the unredacted key. Redact and JSON-escape the key before including it in the diagnostic, as the nearby retryOn429 validation already does.
AGENTS.md reference: AGENTS.md:L233-L234
Useful? React with 👍 / 👎.
⏳ DRAFT
What to do
Its title has been prefixed with |
modelInputModalities maps as string-array recordsmodelInputModalities maps as string-array records
Motivation
modelInputModalitiespersisted or management-submitted values (e.g."grok-4.3": null) from being cloned/spread and throwing a TypeError during registry enrichment.Description
stringArrayRecordConfigErrorvalidator insrc/config.tsthat enforces a plain object whose values are arrays of strings.modelInputModalitiesproduce a controlled config diagnostic instead of surviving parsing.modelInputModalitiesat the management API admission boundary insrc/server/auth-cors.tsso POST/PUT provider submissions with invalid modality maps return400rather than letting enrichment crash.modelInputModalitiesand invalid management POST payloads intests/config.test.tsandtests/management-provider-validation.test.tsrespectively.Testing
bun run typecheckwhich completed successfully.bun run privacy:scanwhich passed.tests/config.test.ts,tests/management-provider-validation.test.ts, andtests/catalog-vision-sidecar-modalities.test.ts, and those targeted test files passed.providerManagementConfigErrorwith anullmodality entry which returned amodelInputModalitiesvalidation error as expected.Codex Task