fix: update health checks to use new ModelFacade client API#470
fix: update health checks to use new ModelFacade client API#470andreatgretel wants to merge 1 commit intomainfrom
Conversation
The ModelFacade constructor was refactored in #373 to accept a ModelClient instead of a SecretResolver. The health_checks.py script was not updated, causing a TypeError (exit code 2) on every run since March 9.
Greptile SummaryThis one-file fix restores the Health Checks workflow by updating Key changes:
Minor pre-existing issue:
|
| Filename | Overview |
|---|---|
| scripts/health_checks.py | Updated _check_model to use create_model_client() factory and pass the resulting client to ModelFacade via the client= keyword argument, correctly aligning with the constructor signature introduced in #373. Only a pre-existing from __future__ import annotations omission remains. |
Sequence Diagram
sequenceDiagram
participant HC as health_checks.py
participant F as create_model_client()
participant SR as EnvironmentResolver
participant PR as ModelProviderRegistry
participant MF as ModelFacade
HC->>SR: EnvironmentResolver()
HC->>PR: _get_provider_registry(provider_name)
HC->>F: create_model_client(model_config, secret_resolver, provider_registry)
F->>SR: resolve(api_key_ref)
F->>PR: get_provider(model_config.provider)
F-->>HC: client (OpenAICompatibleClient / AnthropicClient)
HC->>MF: ModelFacade(model_config, provider_registry, client=client)
MF-->>HC: facade
HC->>MF: facade.generate(...) or facade.generate_text_embeddings(...)
Comments Outside Diff (1)
-
scripts/health_checks.py, line 1-11 (link)Missing
from __future__ import annotationsAGENTS.mdlists this as a structural invariant: "from __future__ import annotations— required in every Python source file." This file is missing that import. Since this file is already being updated in this PR, it's a good time to add it.Context Used: AGENTS.md (source)
Prompt To Fix With AI
This is a comment left during a code review. Path: scripts/health_checks.py Line: 1-11 Comment: **Missing `from __future__ import annotations`** `AGENTS.md` lists this as a structural invariant: *"`from __future__ import annotations` — required in every Python source file."* This file is missing that import. Since this file is already being updated in this PR, it's a good time to add it. **Context Used:** AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=95f8243f-5118-40bc-a3ab-69210b72e57e)) How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: scripts/health_checks.py
Line: 1-11
Comment:
**Missing `from __future__ import annotations`**
`AGENTS.md` lists this as a structural invariant: *"`from __future__ import annotations` — required in every Python source file."* This file is missing that import. Since this file is already being updated in this PR, it's a good time to add it.
```suggestion
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
"""Health checks for all predefined model providers.
Verifies that each model in each provider can respond to a basic request.
Providers without an API key set in the environment are skipped.
Usage:
uv run python scripts/health_checks.py
"""
```
**Context Used:** AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=95f8243f-5118-40bc-a3ab-69210b72e57e))
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix: update health checks to use new Mod..." | Re-trigger Greptile
|
Health checks pipeline is passing again on this branch: https://github.com/NVIDIA-NeMo/DataDesigner/actions/runs/23749207791 All providers passed in 36s (previously failing with exit code 2 since March 9). |
nabinchha
left a comment
There was a problem hiding this comment.
Thanks @andreatgretel!
📋 Summary
The
ModelFacadeconstructor was refactored in #373 to require aModelClientinstead of aSecretResolver, butscripts/health_checks.pywas never updated. This causes aTypeError(exit code 2) on every Health Checks workflow run since March 9.🐛 Fixed
scripts/health_checks.pyto usecreate_model_client()factory and pass the resulting client toModelFacadevia theclientkeyword argument🤖 Generated with AI