fix(client): handle per-language min_sdk_version dict in health_check_detailed#163
Merged
saurabhjain1592 merged 4 commits intomainfrom Apr 28, 2026
Merged
Conversation
…_detailed
The platform /health endpoint returns sdk_compatibility.min_sdk_version
and recommended_sdk_version as per-language maps:
{"go": "5.0.0", "java": "5.0.0", "python": "6.0.0", "typescript": "5.0.0"}
The Python SDK declared both fields as `str` and called `_parse_version()`
on the dict, crashing with `AttributeError: 'dict' object has no attribute
'split'`. Every caller of `health_check_detailed()` was hitting the crash
since the platform shipped version_discovery (4.8.0+).
Fix: type SDKCompatibility fields as `dict[str, str]` and add
`min_sdk_version_for(language)` / `recommended_sdk_version_for(language)`
helpers, matching the Java SDK's `getMinSdkVersionFor()` and TypeScript
SDK's defensive shape handling.
Defensive: if an older platform returns a bare-string min_sdk_version,
normalise to `{"python": str}` so callers don't need to branch.
Tests in tests/test_health_check_detailed.py cover:
- dict-shape happy path
- bare-string legacy fallback
- empty-string legacy
- helper return values for known + unknown languages
Caught by Phase 1 quality-freeze sweep on examples/version-check/python.
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
`health_check_detailed()` was crashing with `AttributeError: 'dict' object has no attribute 'split'` because the SDK typed `min_sdk_version` as a single string while the platform has shipped it as a per-language map since version_discovery landed in 4.8.0:
```json
{"go": "5.0.0", "java": "5.0.0", "python": "6.0.0", "typescript": "5.0.0"}
```
Every caller of `health_check_detailed()` against any platform 4.8.0+ was hitting the crash. Caught by the Phase 1 quality-freeze sweep against `examples/version-check/python`.
What changed
Test plan
Cross-SDK note