Fix strict YAML boolean parsing - #276
Open
fallintoplace wants to merge 1 commit into
Open
Conversation
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.
Summary
Replace truthiness casts for YAML-backed boolean config values with strict parsers. Quoted values like
"false","no", and"0"now parse as false instead of becoming true because they are non-empty strings.This covers the vLLM service wrappers, Piper
use_cuda, VLM MCPenable_thinking, modelhealth_check, and voicegatelistening_chime. Nemotron Omni'suse_bf16path is included too because it had the same string truthiness issue.Invalid boolean strings now raise
ValueErrorwith the config key name instead of silently picking a truthy value.Validation
PYTHONPATH=server-runtime:utils/xr-ai-vllm:agent-sdk/xr-ai-models:agent-mcp-servers/vlm-mcp:utils/xr-ai-voicegate:ai-services/tts/piper:utils/xr-ai-logging:tests uv run --python 3.12 --project agent-sdk --with pytest --with pytest-asyncio --with numpy --with aiohttp --with fastmcp --with pillow --with httpx --with uvicorn --with pyyaml --with loguru pytest tests/test_vllm_lifecycle.py tests/test_models_config.py tests/test_vlm_mcp.py tests/test_xr_ai_voicegate.py tests/test_piper_tts.py::test_piper_config_parses_quoted_use_cuda_false tests/test_piper_tts.py::test_piper_config_rejects_unknown_use_cuda_stringuvx ruff check utils/xr-ai-vllm/xr_ai_vllm/_config.py utils/xr-ai-vllm/xr_ai_vllm/__init__.py ai-services/vlm-server/vlm_server/__main__.py ai-services/llm/llama_nemotron/llama_nemotron_llm_server/__main__.py ai-services/llm/nemotron3_nano/nemotron3_nano_llm_server/__main__.py ai-services/llm/nemotron_omni/nemotron_omni_llm_server/__main__.py ai-services/tts/piper/piper_tts_server/__main__.py agent-sdk/xr-ai-models/xr_ai_models/config.py agent-mcp-servers/vlm-mcp/vlm_mcp_server/__main__.py utils/xr-ai-voicegate/xr_ai_voicegate/config.py tests/test_vllm_lifecycle.py tests/test_models_config.py tests/test_vlm_mcp.py tests/test_xr_ai_voicegate.py tests/test_piper_tts.pygit diff --check