Skip to content

Remove inconsistent parameters in claude sonnet#11719

Merged
mamoodi merged 1 commit intoOpenHands:mainfrom
ParentSquare:forward-litellm-args-for-drop-params
Nov 19, 2025
Merged

Remove inconsistent parameters in claude sonnet#11719
mamoodi merged 1 commit intoOpenHands:mainfrom
ParentSquare:forward-litellm-args-for-drop-params

Conversation

@TuringND
Copy link
Copy Markdown
Contributor

@TuringND TuringND commented Nov 12, 2025

Summary of PR

We found that you can either pass temperature or top_p to claude sonnet 4 models.

Change Type

  • Bug fix
  • New feature
  • Breaking change
  • Refactor
  • Other (dependency update, docs, typo fixes, etc.)

Checklist

  • I have read and reviewed the code and I understand what the code is doing.
  • I have tested the code to the best of my ability and ensured it works as expected.

Fixes

Resolves #(issue)

Release Notes

  • Include this change in the Release Notes.

@TuringND TuringND force-pushed the forward-litellm-args-for-drop-params branch 2 times, most recently from fe31f3b to 589fa8d Compare November 12, 2025 16:23
@TuringND
Copy link
Copy Markdown
Contributor Author

@openhands-agent fix the lint problems please

@mamoodi mamoodi requested review from enyst and removed request for mamoodi November 12, 2025 17:16
@enyst
Copy link
Copy Markdown
Collaborator

enyst commented Nov 12, 2025

@OpenHands This PR fails linting, run a precommit on its files after you make build. Note that this branch is from a fork parentsquare:forward-litellm-args-for-drop-params, so you know where to commit.

@openhands-ai
Copy link
Copy Markdown

openhands-ai Bot commented Nov 12, 2025

I'm on it! enyst can track my progress at all-hands.dev

@enyst
Copy link
Copy Markdown
Collaborator

enyst commented Nov 12, 2025

Out of curiosity, could you perhaps share some log @TuringND ? I’m a bit surprised it was Sonnet 4, because I’m pretty sure we used it extensively on OpenHands, without dropping top_p IIRC. 🤔

@openhands-ai
Copy link
Copy Markdown

openhands-ai Bot commented Nov 12, 2025

Summary of work

What I did

  • Checked out parentsquare/forward-litellm-args-for-drop-params and set it as the working branch.
  • Ran make build (installed Node.js 22.21.0 as part of setup; frontend built successfully; hooks installed).
  • Ran backend pre-commit on PR files: openhands/llm/llm.py and tests/unit/llm/test_llm.py using ./dev_config/python/.pre-commit-config.yaml.
  • Ruff-format reformatted openhands/llm/llm.py; re-ran hooks and all passed (ruff, ruff-format, mypy, etc.).
  • Committed the change:

Change details

  • Only formatting in openhands/llm/llm.py (conditional line wrapping). No functional changes.
  • tests/unit/llm/test_llm.py required no changes.

Checklist against your instructions

  • Make build: done
  • Run pre-commit on PR files: done
  • Fix lint issues: done (all hooks pass locally)
  • Commit changes: done
  • Push changes to parentsquare:forward-litellm-args-for-drop-params: attempted but blocked (403 permission denied)

Why push didn’t happen

  • Pushing to parentsquare/OpenHands.git returned 403 (permission denied for the current token/user).

Next step (needed from you)

  • Please enable “Allow edits from maintainers” on the PR and/or grant push permission to the parentsquare fork branch so I can push this commit to parentsquare:forward-litellm-args-for-drop-params.
  • Alternatively, I can open a new branch on the OpenHands repo and a PR with just this formatting fix if you prefer.

View full conversation

@TuringND
Copy link
Copy Markdown
Contributor Author

Out of curiosity, could you perhaps share some log @TuringND ? I’m a bit surprised it was Sonnet 4, because I’m pretty sure we used it extensively on OpenHands, without dropping top_p IIRC. 🤔

This problem can be seen when setting temperature=0 using bedrock as provider to anthropic Sonnet 4.5. :

litellm.exceptions.BadRequestError: litellm.BadRequestError: BedrockException - {"message":"The model returned the following errors: `temperature` and `top_p` cannot both be specified for this model. Please use only one."}

I can make it more specific though I think the patch misses the -5.

@TuringND
Copy link
Copy Markdown
Contributor Author

Summary of work

What I did

  • Checked out parentsquare/forward-litellm-args-for-drop-params and set it as the working branch.

  • Ran make build (installed Node.js 22.21.0 as part of setup; frontend built successfully; hooks installed).

  • Ran backend pre-commit on PR files: openhands/llm/llm.py and tests/unit/llm/test_llm.py using ./dev_config/python/.pre-commit-config.yaml.

  • Ruff-format reformatted openhands/llm/llm.py; re-ran hooks and all passed (ruff, ruff-format, mypy, etc.).

  • Committed the change:

Change details

  • Only formatting in openhands/llm/llm.py (conditional line wrapping). No functional changes.
  • tests/unit/llm/test_llm.py required no changes.

Checklist against your instructions

  • Make build: done
  • Run pre-commit on PR files: done
  • Fix lint issues: done (all hooks pass locally)
  • Commit changes: done
  • Push changes to parentsquare:forward-litellm-args-for-drop-params: attempted but blocked (403 permission denied)

Why push didn’t happen

  • Pushing to parentsquare/OpenHands.git returned 403 (permission denied for the current token/user).

Next step (needed from you)

  • Please enable “Allow edits from maintainers” on the PR and/or grant push permission to the parentsquare fork branch so I can push this commit to parentsquare:forward-litellm-args-for-drop-params.
  • Alternatively, I can open a new branch on the OpenHands repo and a PR with just this formatting fix if you prefer.

View full conversation

@openhands-agent Can you add a suggestion commit comment with the changes please?

@TuringND
Copy link
Copy Markdown
Contributor Author

Out of curiosity, could you perhaps share some log @TuringND ? I’m a bit surprised it was Sonnet 4, because I’m pretty sure we used it extensively on OpenHands, without dropping top_p IIRC. 🤔

I'm thinking on dropping this PR and creating a clean one out of the OpenHands remote instead of the fork with the lint problems fixed and addressing the Sonnet 4-5 only not Sonnet 4 @enyst .

@enyst
Copy link
Copy Markdown
Collaborator

enyst commented Nov 14, 2025

@TuringND Ah it’s Bedrock, that explains it, thank you! These can indeed vary per provider.

As you wish, with the PR. I think running make build installs precommit hooks, so that it autofixes.

@enyst
Copy link
Copy Markdown
Collaborator

enyst commented Nov 16, 2025

@TuringND I also wonder if maybe I'm wrong, and the condition under which you experience it has also something to do with extended_thinking... We've seen that before on Opus.

More importantly, though, I really appreciate the fix because we need to fix this, the strange thing right now is that we're just about to transition this repository to V1, the next major version of OpenHands. It's merged already and a lot of work is actually going on on V1, it's just not enabled by default.

That matters here because V1 is built on OpenHands Software Agent SDK, and it is in the SDK that LLM component is handled. So once we merge here, we need the fix in agent-sdk as well, or, if you'd like, the other way around. 😅 I would deeply appreciate if you want to port the fix!

@TuringND TuringND force-pushed the forward-litellm-args-for-drop-params branch from ea8e0a4 to a0644bb Compare November 18, 2025 13:01
@TuringND
Copy link
Copy Markdown
Contributor Author

@TuringND I also wonder if maybe I'm wrong, and the condition under which you experience it has also something to do with extended_thinking... We've seen that before on Opus.

More importantly, though, I really appreciate the fix because we need to fix this, the strange thing right now is that we're just about to transition this repository to V1, the next major version of OpenHands. It's merged already and a lot of work is actually going on on V1, it's just not enabled by default.

That matters here because V1 is built on OpenHands Software Agent SDK, and it is in the SDK that LLM component is handled. So once we merge here, we need the fix in agent-sdk as well, or, if you'd like, the other way around. 😅 I would deeply appreciate if you want to port the fix!

Thank you for your kind words, I've just forced-push the linting fix and I'll schedule some time to introduce this fix in the agent-sdk too.

@mamoodi mamoodi merged commit 4c57a98 into OpenHands:main Nov 19, 2025
23 checks passed
@TuringND
Copy link
Copy Markdown
Contributor Author

TuringND commented Dec 9, 2025

@TuringND I also wonder if maybe I'm wrong, and the condition under which you experience it has also something to do with extended_thinking... We've seen that before on Opus.

More importantly, though, I really appreciate the fix because we need to fix this, the strange thing right now is that we're just about to transition this repository to V1, the next major version of OpenHands. It's merged already and a lot of work is actually going on on V1, it's just not enabled by default.

That matters here because V1 is built on OpenHands Software Agent SDK, and it is in the SDK that LLM component is handled. So once we merge here, we need the fix in agent-sdk as well, or, if you'd like, the other way around. 😅 I would deeply appreciate if you want to port the fix!

@enyst I started working on this and in a separated PR on token caching that fixes what we have experienced with Bedrock. I intended to ask you about the upgrade from 0.62 to v1 in headless mode. I'd better open a discussion issue ?

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.

3 participants