PLTF-2295: Upgrade litellm for opus 4.7 - #616
Conversation
The LiteLLM proxy must have an explicit model entry for claude-opus-4-7
so that the openhands provider (litellm_proxy/claude-opus-4-7) can route
requests to it. Without this entry the proxy rejects the request with
"Invalid model name passed in model=claude-opus-4-7".
Using the openhands provider through the proxy is required to avoid a
bug in LiteLLM 1.83.14 where thinking: {type: enabled} is not correctly
translated to adaptive thinking format when calling Anthropic directly
with claude-opus-4-7.
all-hands-bot
left a comment
There was a problem hiding this comment.
🟡 Acceptable with critical concerns that must be addressed before deployment.
This PR upgrades LiteLLM to add Claude Opus 4.7 support, but deploys a version with a known bug requiring a proxy workaround. The Helm Chart Checklist is incomplete and there's no evidence the changes were tested.
Code Review Analysis[CRITICAL ISSUES]
[IMPROVEMENT OPPORTUNITIES]
# Workaround for LiteLLM 1.83.14 bug: routes through proxy to use reasoning_effort path
# instead of broken thinking parameter translation. Tracked in: https://github.com/BerriAI/litellm/pull/27074
# TODO: Re-evaluate this configuration once the upstream fix is released
- model_name: "claude-opus-4-7"
litellm_params:
model: "anthropic/claude-opus-4-7"
api_key: os.environ/ANTHROPIC_API_KEY
[TESTING GAPS]
[RISK ASSESSMENT]
This PR presents HIGH risk due to:
Recommendation: Do not auto-merge. Request review from:
Alternative safer approach:
VERDICT: ❌ Needs rework: While the code changes are minimal and structurally sound, critical process requirements are missing (Evidence, Helm Chart Checklist), and deploying a known-buggy version with a workaround presents unacceptable production risk without proper validation and documentation. KEY INSIGHT: The technical implementation is straightforward, but the risk profile is elevated by deploying known-buggy infrastructure code (LiteLLM) without testing evidence or a timeline for when the proper fix will be available—a workaround is only acceptable if its failure modes are well-understood and documented.
|
Co-authored-by: openhands <openhands@all-hands.dev>
all-hands-bot
left a comment
There was a problem hiding this comment.
🟡 Acceptable - Pragmatic solution with documented workaround.
All previous review concerns have been addressed:
- Inline comment added explaining the temporary workaround (commit 80bc0e2)
- Evidence provided via screenshots showing successful deployment and Claude Opus 4.7 usage
- Helm Chart Checklist explained (not applicable for Replicated configs)
- Version alignment with SaaS environment documented
The implementation is straightforward:
- Version bump to v1.83.14-stable to match SaaS
- Model proxy entry with clear temporary workaround comment
- Upstream fix tracked in LiteLLM PR #27074
[RISK ASSESSMENT]
This change upgrades LiteLLM across minor versions (v1.82.3 → v1.83.14) and includes a workaround for a known bug where direct Anthropic API calls fail for Claude Opus 4.7. Risk is mitigated by:
- Version already deployed and validated in the SaaS environment
- Workaround clearly documented with inline comments and tracked upstream fix (LiteLLM PR #27074)
- Evidence shows successful deployment and usage in Replicated install
- Changes isolated to Replicated configs (not core Helm charts)
- Bug only affects direct Anthropic provider path; proxy path (used by this workaround) works correctly
Risk factors elevating to MEDIUM:
- Infrastructure-level change affecting LLM proxy configuration (moderate blast radius)
- Dependency upgrade with known bug requiring workaround
- Core system impact on LLM access layer
VERDICT:
✅ Worth merging - Pragmatic solution to enable Claude Opus 4.7 support with well-documented workaround
KEY INSIGHT:
This PR prioritizes delivering Claude Opus 4.7 support now with a documented workaround rather than waiting for upstream fix - a reasonable pragmatic trade-off given SaaS validation and tracked remediation path.
all-hands-bot
left a comment
There was a problem hiding this comment.
🟡 Acceptable - Pragmatic workaround with strong testing evidence, but one startup argument needs clarification.
The upgrade addresses real production issues (Claude Opus 4.7 support + schema thrashing fix) and follows pragmatic engineering with a well-documented workaround. Testing evidence is strong. One configuration detail needs explanation before merge.
|
Going to set this back to draft as an incremental upgrade revealed org settings 500s when trying to set the default model to the proxied opus model |
…PATCH fix Temporarily pins enterprise-server to sha-d316113 (OpenHands/OpenHands#14326) to fix 500 errors when saving org settings on installs upgrading from a version where agent_kind='llm' was persisted in the DB. To be updated to the release tag once #14326 merges.
all-hands-bot
left a comment
There was a problem hiding this comment.
🟡 Acceptable - Pragmatic upgrade with comprehensive testing evidence.
All previous review concerns have been addressed. The LiteLLM version upgrade, migration resolver flag, and proxy workaround are well-documented and tested. Configuration changes are straightforward.
[RISK ASSESSMENT]
Infrastructure change affecting critical LLM inference path with multiple temporary workarounds (SHA override + proxy model). Risk is mitigated by: comprehensive testing evidence covering both fresh and upgrade install paths, SaaS version alignment (already production-proven at v1.83.14-stable), and clear rollback strategy to v1.82.3-stable.patch.3. Temporary workarounds are documented with upstream fix tracking.
VERDICT:
✅ Worth merging: Pragmatic solution to production needs
KEY INSIGHT:
Bundling related LiteLLM infrastructure changes with production validation reduces deployment complexity despite multiple moving parts.
all-hands-bot
left a comment
There was a problem hiding this comment.
🟢 Good taste - Pragmatic infrastructure upgrade with comprehensive testing.
All previous review concerns have been addressed. The LiteLLM version upgrade, migration resolver flag, and proxy workaround are well-documented with clear tracking for permanent fixes:
- Proxy model entry: temporary workaround for LiteLLM thinking translation bug (tracked in LiteLLM PR #27074)
- Enterprise-server SHA override: fixes org settings 500 errors on upgrade (tracked in OpenHands/OpenHands#14326)
- Migration resolver: prevents schema thrashing during rolling deployments (addresses PLTF-2292)
Testing evidence is excellent: screenshots of working config, upgrade path validation (0.7.3→0.7.8), and verification of both fresh install and upgrade scenarios.
[RISK ASSESSMENT]
Infrastructure change affecting critical LLM inference path with multiple temporary workarounds. Risk is mitigated by:
- Comprehensive end-to-end testing on both install paths
- Clear documentation and tracking of temporary measures
- Version alignment with production SaaS environment (v1.83.14)
- Successful migration validation (11 migrations applied cleanly)
VERDICT:
✅ Worth merging - Solves real production problems with well-tested pragmatic solutions.
KEY INSIGHT:
Temporary workarounds for upstream bugs are acceptable when properly documented, tested, and tracked - this PR demonstrates that pattern well.
Description
Upgrades LiteLLM from
v1.82.3-stable.patch.3tov1.83.14-stableto match the version we use in SaaS (cloud). Adds support for Claude Opus 4.7 by adding the model to the LiteLLM proxy model list as a workaround given the LiteLLM bug when using the Anthropic provider directly. Also includes a temporary enterprise-server image override (sha-d316113) that fixes org settings 500 errors on upgrade installs (OpenHands/OpenHands#14326).Changes
v1.82.3-stable.patch.3→v1.83.14-stableclaude-opus-4-7→anthropic/claude-opus-4-7--use_v2_migration_resolveron LiteLLM startup to prevent schema thrashing during upgradessha-d316113to include the org settings PATCH write-path fix (PLTF-2295: org settings PATCH for legacy agent_kind rows OpenHands#14326); to be replaced with a release tag once that PR mergesWhy the proxy model entry is required
LiteLLM 1.83.14 has a bug where
thinking: {type: enabled}is not correctly translated to the adaptive thinking format when calling Anthropic directly with claude-opus-4-7, causing aBadRequestErrorfrom the Anthropic API. The workaround is to route requests through the LiteLLM proxy using theopenhandsprovider (litellm_proxy/claude-opus-4-7), which uses thereasoning_effortparameter path that works correctly in this version.Without the proxy model entry, the proxy rejects requests with "Invalid model name passed in model=claude-opus-4-7". The upstream fix is tracked in LiteLLM PR #27074.
Why the v2 migration resolver is required
Without
--use_v2_migration_resolver, LiteLLM's_resolve_all_migrationslogic can thrash the database schema during rolling deployments when two versions contend for the same database. This flag limits migration behavior toprisma migrate deployonly, preventing the diff-and-force recovery path that caused a production incident (PLTF-2292) on April 29, 2026. Customers upgrading from v1.82.3 to v1.83.14 are exposed to this without the flag.Why
--config /etc/litellm/config.yamlis explicitly addedThis is not a new LiteLLM 1.83.14 requirement. The upstream
litellm-helmchart already starts LiteLLM with--config /etc/litellm/config.yamlby default so it loads the mounted proxy config (includingproxy_config.model_list).In this PR we also need to add
--use_v2_migration_resolver. Because the chart'sargsvalue replaces the entire default argument list rather than appending to it, we must restate--config /etc/litellm/config.yamlalongside the new flag. Without it, LiteLLM would start without loading the mounted config file and would ignore the configured proxy models.Why the enterprise-server image override is required
Customers upgrading from an older version have
agent_kind='llm'stored in their org'sagent_settingsDB column (written by the old enterprise server beforeLLMAgentSettingswas renamed toOpenHandsAgentSettings). ThePATCH /api/organizations/{id}/settingswrite path validates the merged settings againstOpenHandsAgentSettingswithout normalizing the legacy value, causing a 500 error that prevents saving org settings — including switching tolitellm_proxy/claude-opus-4-7. The fix is in OpenHands/OpenHands#14326. Thesha-d316113override will be replaced with the official release tag once that PR merges.Usage
In OpenHands org defaults, configure:
openhands/claude-opus-4-7http://openhands-litellm:4000Helm Chart Checklist
versionfield inChart.yamlfor each modified chartChanges are only in the Replicated configs not the main charts so no version bump is needed.
Additional Notes
The LiteLLM thinking translation bug affects the
anthropicprovider path only. Theopenhandsprovider path (via the LiteLLM proxy) is unaffected and works correctly with this configuration.Verified in a Replicated install that this configuration upgrades LiteLLM to 1.83.14. Also allows us to use the Claude Opus 4.7 model via the OpenHands provider to use the proxied model:


Looking at the exported conversation metadata confirms the model used in the test conversation is the proxied model:

Tested the upgrade path from 0.7.3 → 0.7.8 on a Replicated embedded cluster VM. LiteLLM startup logs confirmed the v2 migration resolver was active (
Using v2 migration resolver (--use_v2_migration_resolver)), 11 pending migrations were applied cleanly viaprisma migrate deploy, and no schema thrashing occurred. The diff-and-force recovery path was not triggered.Verified the org settings PATCH fix (OpenHands/OpenHands#14326) on both install paths using enterprise-server
sha-d316113:agent_kind='openhands', org settings saved successfully withlitellm_proxy/claude-opus-4-7, conversation completed and confirmed viaconversation_metadata.llm_model = litellm_proxy/claude-opus-4-7in the DB ✅agent_kind='llm'in DB before upgrade, org settings saved successfully after upgrade withagent_kindnormalized to'openhands'and model updated tolitellm_proxy/claude-opus-4-7in the DB ✅