refactor(sdk/llm/mixim): separate data from logic#2354
Conversation
API breakage checks (Griffe)Result: Passed |
Agent server REST API breakage checks (OpenAPI)Result: Failed Log excerpt (first 1000 characters) |
all-hands-bot
left a comment
There was a problem hiding this comment.
Clean refactoring that separates data from logic. Verified no breaking changes - the moved constants and functions are not imported elsewhere. This improves maintainability by reducing merge conflict risk and making both concerns easier to navigate.
all-hands-bot
left a comment
There was a problem hiding this comment.
🟢 Good taste - Clean separation of data from logic that makes both concerns easier to navigate and maintain. No behavior change, no breaking changes, reduces cognitive load. LGTM.
Ah don't worry. It is not high priority. I was justing testing the refactoring capability of OH :-) |
|
@OpenHands pls merge from main and resolve conflicts |
|
I'm on it! xingyaoww can track my progress at all-hands.dev |
Incorporate security_risk and summary parameters into tool examples in fn_call_examples.py to match the changes made on main in fn_call_converter.py. Also uses single-line command format consistent with main. Co-authored-by: openhands <openhands@all-hands.dev>
|
Here's a summary of the work done: SummaryThe PR branch What was done:
Verification:
The PR is at: #2354 |
|
@OpenHands review diff from main and review this PR. Check carefully and tell me, did we make ANY copy-pasting error in the refactor PR? |
|
I'm on it! xingyaoww can track my progress at all-hands.dev |
Review: Checking for copy-paste errors in the refactorI did a thorough diff-level and runtime-equivalence check. Here are the results: ✅
|
SummaryThe PR was reviewed for copy-paste errors as requested. No code changes were made — this was purely an analysis task. Answer to the Review QuestionNo copy-paste errors were found in the refactor. Here's what I verified:
The refactor is a clean extraction: data moved to |
Summary
Separating data from logic.
Before, fn_call_converter.py was 1288 lines where ~380 lines of prompt example strings were interleaved with the actual
conversion algorithms. When you opened the file to understand or modify the conversion logic, you had to scroll past
hundreds of lines of static text. And when you wanted to update an example prompt, you had to navigate through parsing
and regex code to find it.
Now the responsibilities are clear:
changes)
These two concerns change for different reasons and at different times. A tool rename touches the examples file. A bug in
parameter parsing touches the converter file. Before, both changes happened in the same 1288-line file, increasing the
chance of merge conflicts and making code review harder because reviewers had to mentally separate data edits from logic
edits.
Checklist
Agent Server images for this PR
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdknikolaik/python-nodejs:python3.13-nodejs22golang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:d367529-pythonRun
All tags pushed for this build
About Multi-Architecture Support
d367529-python) is a multi-arch manifest supporting both amd64 and arm64d367529-python-amd64) are also available if needed