fix(api): preserve legacy score create alias - #1786
Merged
Merged
Claude / Claude Code Review
completed
Jul 29, 2026 in 14m 28s
Code review found 1 important issue
Found 4 candidates, confirmed 2. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 1 |
| 🟡 Nit | 1 |
| 🟣 Pre-existing | 0 |
| Severity | File:Line | Issue |
|---|---|---|
| 🔴 Important | scripts/patch_generated_score_compat.py:133-146 |
_append_type_exports crashes on Fern header-only init.py (no all) |
| 🟡 Nit | scripts/patch_generated_score_compat.py:172-194 |
Compat shim does not patch raw_client.py — with_raw_response.create breaks |
Annotations
Check failure on line 146 in scripts/patch_generated_score_compat.py
claude / Claude Code Review
_append_type_exports crashes on Fern header-only __init__.py (no __all__)
_append_type_exports() writes `__all__ = [*__all__, ...]` to legacy/score_v1/__init__.py and legacy/__init__.py with no fallback if `__all__` doesn't already exist, unlike legacy_types_path which has one. Fern emits header-only __init__.py files (no __all__) for packages with zero exported types — confirmed live in this repo at langfuse/api/prompt_version/__init__.py — and since legacy/score_v1/__init__.py currently exports only the three create-related types, it will very likely regenerate into
Check warning on line 194 in scripts/patch_generated_score_compat.py
claude / Claude Code Review
Compat shim does not patch raw_client.py — with_raw_response.create breaks
The postprocessor only patches `legacy/score_v1/client.py`, adding a delegating `create`/`async create`, but never touches `legacy/score_v1/raw_client.py`. Once the coordinated Fern PR removes `create` from the raw clients, `client.legacy.score_v1.with_raw_response.create(...)` will raise `AttributeError` even though the plain `client.legacy.score_v1.create(...)` keeps working. This is a real but narrow gap in legacy API preservation, with no test coverage for `with_raw_response`.
Loading