1 Commits

Author SHA1 Message Date
yetuge
6e76c14384
fix(config): reject boolean integer settings in app_config (#6171)
* fix(config): reject boolean integer settings in app_config

Follows the loop-detection and circuit-breaker guards: YAML booleans next
to integer knobs load cleanly, and Pydantic coerces booleans to 1/0.

- recursion_limit coerced from `true` to 1, so every Gateway run that does
  not supply its own limit hit the LangGraph recursion ceiling at the
  first super-step (max_recursion_limit likewise clamped the ceiling to 1).
- The five llm_call integers coerced similarly: retry_max_attempts as
  `true` disabled retries, max_concurrent_calls as `true` serialized the
  pipeline.

All seven integer fields now fail configuration loading with a
field-specific error, while valid integers and numeric strings keep their
existing behavior. Mirrors the loop-detection helper (#6017) and the
in-file circuit-breaker validator.

Signed-off-by: yetuge <2219677952@qq.com>

* docs(changelog): record the app-config boolean rejection

Changelog entries for #6171, mirroring the #6017 entry format in both
languages.

Signed-off-by: yetuge <2219677952@qq.com>

* test(config): pin the False-side coercion regression in the boolean guards

Per review: the tests only exercised `True`. On the `ge=1` fields `false`
already failed the constraint pre-fix, but on the `ge=0` fields
(`max_concurrent_calls`, the two delay fields) `false` coerced silently to
the harmless-looking `0`, disabling the concurrency cap with no error.
Parametrize both boolean tests over `[True, False]` to lock that regression
in as well.

Signed-off-by: yetuge <2219677952@qq.com>

---------

Signed-off-by: yetuge <2219677952@qq.com>
2026-10-03 14:29:41 +08:00