Skip to content

Remove python_version from API payloads, use language_version#1914

Merged
KRRT7 merged 3 commits intomainfrom
remove-python-version-field
Mar 27, 2026
Merged

Remove python_version from API payloads, use language_version#1914
KRRT7 merged 3 commits intomainfrom
remove-python-version-field

Conversation

@KRRT7
Copy link
Copy Markdown
Collaborator

@KRRT7 KRRT7 commented Mar 27, 2026

Summary

  • Remove python_version from all API payloads (add_language_metadata, optimize, rank, optimization_review)
  • Fix optimization_review to use current_language_support().language_version instead of hardcoded Python-only detection, so Java/JS/TS get their version populated correctly
  • Update test_add_language_metadata.py to reflect the removal

Depends on codeflash-ai/codeflash-internal#2488 being deployed first — the backend validators resolve python_version from language_version for backward compatibility.

Test plan

  • tests/test_add_language_metadata.py — 10 tests pass
  • Verify against deployed backend with the backward-compat validators

KRRT7 added 2 commits March 27, 2026 02:53
Use language_version exclusively — the backend now resolves
python_version from language_version for backward compatibility.
Use current_language_support().language_version instead of
hardcoded Python-only detection, so Java/JS/TS get their
version populated correctly.
@claude
Copy link
Copy Markdown
Contributor

claude bot commented Mar 27, 2026

Claude finished @KRRT7's task in 3m 59s —— View job


PR Review Summary

Prek Checks

Fixed one issue: import platform was left behind in codeflash/api/aiservice.py after all platform.python_version() calls were removed. Committed and pushed the fix (commit 33d92809).

All prek checks now pass.

Code Review

SMALL PR — focused correctness check.

The changes are clean and correct:

  • add_language_metadata (aiservice.py:62): Removing the python_version field is safe — the backend handles backward compatibility via language_version.
  • optimize payload (aiservice.py:270): Same — clean removal.
  • rank payload (aiservice.py:532): Previously used platform.python_version() hardcoded for Python, now correctly omitted.
  • optimization_review payload (aiservice.py:840-841): This is the most important fix. Previously language_version was None for non-Python languages. Now it uses current_language_support().language_version, which correctly populates Java/JS/TS versions.

No bugs, security issues, or breaking API changes found.

Duplicate Detection

No duplicates detected. The language_version fix in optimization_review is a single call site — no parallel language modules needed updating.


Last updated: 2026-03-27

Co-authored-by: Kevin Turcios <undefined@users.noreply.github.com>
@KRRT7 KRRT7 merged commit 44cbc00 into main Mar 27, 2026
26 of 36 checks passed
@KRRT7 KRRT7 deleted the remove-python-version-field branch March 27, 2026 08:51
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