Skip to content

Fix strict YAML boolean parsing - #276

Open
fallintoplace wants to merge 1 commit into
NVIDIA:mainfrom
fallintoplace:fix/strict-yaml-booleans
Open

Fix strict YAML boolean parsing#276
fallintoplace wants to merge 1 commit into
NVIDIA:mainfrom
fallintoplace:fix/strict-yaml-booleans

Conversation

@fallintoplace

Copy link
Copy Markdown

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 MCP enable_thinking, model health_check, and voicegate listening_chime. Nemotron Omni's use_bf16 path is included too because it had the same string truthiness issue.

Invalid boolean strings now raise ValueError with 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_string
  • uvx 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.py
  • git diff --check

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.

1 participant