Skip to content

fix(models): preserve zero and false parameters during validation - #1447

Open
Kapozux wants to merge 1 commit into
dataease:mainfrom
Kapozux:codex/fix-model-validation-falsy
Open

Kapozux wants to merge 1 commit into
dataease:mainfrom
Kapozux:codex/fix-model-validation-falsy

Conversation

@Kapozux

@Kapozux Kapozux commented Nov 7, 2026

Copy link
Copy Markdown

Model validation drops numeric zero and boolean false from additional parameters, so the configuration checked can differ from the configuration used at runtime. Replace the truthiness filter with explicit missing/empty-string checks, preserving zero, false and supplied empty containers while continuing to skip empty keys, None and empty strings.

Fixes #1446.

Validation:

  • Python 3.11.11: 18 new offline regression cases execute the production handler, real request DTOs, parameter parser, LLMConfig and StreamingResponse with a substituted model transport. On the unmodified base, 6 fail and 12 pass; with the fix, all 18 pass.
  • New regressions plus existing supplier configuration checks: 40 passed.
  • Ruff check and format check pass for the new test file; git diff --check passes. The production file retains the same 18 existing Ruff findings and requires formatting both before and after this change; no unrelated cleanup is included.

This concerns typed API/configuration values; manually typing "0" into the current text input produces a string and does not reproduce the zero-value case. No live authenticated HTTP route, database, browser or external LLM was exercised. The existing LLMConfig Pydantic deprecation warnings remain.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Model validation drops numeric zero and false parameter values

1 participant