[WRONG BRANCH] management: reject non‑object JSON bodies for /api/custom-models POST/PUT - #209
[WRONG BRANCH] management: reject non‑object JSON bodies for /api/custom-models POST/PUT#209luvs01 wants to merge 1 commit into
Conversation
|
Warning Review limit reached
Next review available in: 56 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 (2)
Comment |
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Its title has been prefixed with |
Motivation
null, arrays, or strings could be parsed and then dereferenced, causing an unhandled TypeError.400before any property access, preserving existing functionality and management-plane admission controls.Description
src/server/management/model-routes.tsto read the body asunknownand return400 { error: "invalid JSON body" }whenisPlainRecord(body)is false.null/array/string bodies and restores a predictable validation path for non-object JSON.tests/catalog-input-modality-enum.test.tsthat assertsPOSTandPUTreturn400fornull, arrays, and strings and that no config persistence occurs.Testing
bun run typecheck(bun x tsc --noEmit) and it passed.tests/catalog-input-modality-enum.test.tsand all tests in that file passed (11 pass, 0 fail).bun run privacy:scanand it passed.bun run testsuite but the GUI integration step failed to build due to external npm registry 403 errors (network/package fetch issue), so the entire full-suite run could not complete in this environment.Codex Task