feat: Azure OpenAI / Azure AI Foundry support. Models should be defined in conf/azure_models.json (or a custom path). See .env.example for environment variables or see readme. https://github.com/BeehiveInnovations/zen-mcp-server/issues/265
feat: OpenRouter / Custom Models / Azure can separately also use custom config paths now (see .env.example )
refactor: Model registry class made abstract, OpenRouter / Custom Provider / Azure OpenAI now subclass these
refactor: breaking change: `is_custom` property has been removed from model_capabilities.py (and thus custom_models.json) given each models are now read from separate configuration files
- Fix test_resource_loading_success by removing outdated mock targeting non-existent 'files' import
- Simplify resource loading test to validate registry functionality directly
- Add .zen_venv exclusion to ruff and black in code_quality_checks.sh
- All tests now passing (793/793) with clean linting
- Remove redundant path checks between Path("conf/custom_models.json") and Path.cwd() variants
- Implement proper importlib.resources.files('conf') approach for robust packaging
- Create conf/__init__.py to make conf a proper Python package
- Update pyproject.toml to include conf* in package discovery
- Clean up verbose comments and simplify resource loading logic
- Fix test mocking to use correct importlib.resources.files target
- All tests passing (8/8) with proper resource and fallback functionality
Addresses all gemini-code-assist bot feedback from PR #227
Improvements based on gemini-code-assist bot feedback:
1. **Proper importlib.resources implementation:**
- Use files("providers") / "../conf/custom_models.json" for resource loading
- Prioritize resource loading over file system paths for packaged environments
- Maintain backward compatibility with explicit config paths and env variables
2. **Remove redundant path checks:**
- Eliminated duplicate Path("conf/custom_models.json") and Path.cwd() / "conf/custom_models.json"
- Streamlined fallback logic to development path + working directory only
3. **Enhanced test coverage:**
- Mock-based testing of actual fallback scenarios with Path.exists
- Proper resource loading simulation and failure testing
- Comprehensive coverage of both resource and file system modes
4. **Robust error handling:**
- Graceful fallback from resources to file system when resource loading fails
- Clear logging of which loading method is being used
- Better error messages indicating resource vs file system loading
The implementation now follows Python packaging best practices using importlib.resources
while maintaining full backward compatibility and robust fallback behavior.
Tested: All 8 test cases pass, resource loading works in development,
file system fallback works when resources fail.
Resolves issues #203, #186, #206, #185 where OpenRouter model registry
completely failed to load in uvx installations due to inaccessible
conf/custom_models.json file.
Changes:
- Implement multiple path resolution strategy in OpenRouterModelRegistry
- Development: Path(__file__).parent.parent / "conf" / "custom_models.json"
- UVX working dir: Path("conf/custom_models.json")
- Current working dir: Path.cwd() / "conf" / "custom_models.json"
- Add importlib-resources fallback for Python < 3.9 compatibility
- Add comprehensive test suite for path resolution scenarios
- Ensure graceful handling when config files are missing
The fix restores full OpenRouter functionality (15 models, 62+ aliases)
for users installing via uvx while maintaining backward compatibility
for development and explicit config scenarios.
Tested: All path resolution scenarios pass, OpenRouter models load correctly