Here’s a concise summary of the work completed and what changed since the last update.
What I changed (in OpenHands/agent-sdk)
• Root cause: The CLI injects dynamic session metadata into LLM.litellm_extra_body at load/restore. On resume, the SDK compared runtime-injected values against persisted JSON and flagged a diff, even though the persisted files were unchanged.
• Fix: Treat litellm_extra_body as a runtime override during reconciliation, same as secrets (api_key, aws_*).
◦ File: openhands-sdk/openhands/sdk/llm/llm.py
◦ Change: Added "litellm_extra_body" to LLM.OVERRIDE_ON_SERIALIZE so the runtime value overrides persisted before strict comparison.
• Tests:
◦ Added tests/sdk/llm/test_llm_reconciliation.py to ensure litellm_extra_body diffs are ignored and runtime values are used.
◦ Fixed tests/cross/test_agent_reconciliation.py by removing stray/duplicated lines causing IndentationError and ensuring the reconciliation path runs cleanly.
Verification
• agent-sdk:
◦ pre-commit (ruff format/lint, pyright, pycodestyle) pass.
◦ New reconciliation tests pass.
• openhands-cli:
◦ Running CLI tests with PYTHONPATH pointed at local agent-sdk: 143 passed.
◦ Programmatic resume smoke test worked: no diff/reconciliation errors (LLM call failed due to missing real API key, which is expected in this environment).
Checklist
• Investigated CLI vs agent-sdk code paths for litellm_extra_body. Done
• Identified runtime vs persisted mismatch as cause. Done
• Implemented minimal, focused fix in the correct repo (agent-sdk). Done
• Added tests to prevent regression. Done
• Lint/tests passing. Done
• Verified CLI resume path no longer errors. Done (within environment constraints)
Branch/PR
• Created branch: fix/cli-resume-litellm-extra-body
• Opened draft PR:
https://github.com/OpenHands/software-agent-sdk/pull/1115
◦ Title: Fix resume reconciliation by treating litellm_extra_body as runtime override
◦ Includes code fix and tests
◦ Co-authored-by: openhands <openhands@all-hands.dev>
Questions for you
• Would you like me to mark the PR as ready for review and convert from draft?
• Do you want any additional tests (e.g., CLI integration test explicitly checking resume behavior), or is the current unit test coverage sufficient?
If you want any changes to the PR title/description or branch name, let me know and I’ll update accordingly.
<sub>
View full conversation</sub>