Conversation
Co-authored-by: openhands <openhands@all-hands.dev>
API breakage checks (Griffe)Result: Passed |
Agent server REST API breakage checks (OpenAPI)Result: Failed Log excerpt (first 1000 characters) |
Coverage Report •
|
|||||||||||||||||||||||||||||||||||
all-hands-bot
left a comment
There was a problem hiding this comment.
Taste Rating: 🟢 Good taste
Analysis:
This PR solves a real problem - centralizing settings schema as a single source of truth for downstream clients. The data structure choice (Pydantic model with field metadata) is pragmatic and follows established patterns.
Data Structure: Clean. Settings live in one place, metadata is co-located with field definitions, and the schema export is straightforward.
Simplicity: The conversion logic handles real use cases (create vs update, custom factories) without over-engineering. Test coverage validates real behavior - agent round-tripping works, factories integrate correctly, schema export produces the right structure.
Backward Compatibility: Purely additive - no existing APIs changed.
Verdict: ✅ Worth merging
Key Insight: By making SDKSettings the declarative source of truth with exportable schema, this eliminates the need for clients to reverse-engineer agent configuration or maintain duplicate settings definitions.
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
all-hands-bot
left a comment
There was a problem hiding this comment.
Taste Rating: 🟡 Acceptable - Solid engineering approach solving a real problem.
Data Structure: Clean. Settings metadata lives alongside field definitions via Pydantic annotations, avoiding the anti-pattern of duplicate config models that drift from the source of truth.
Verdict: ✅ Worth merging. The core design is sound - annotating canonical fields eliminates special cases and maintains a single source of truth. Minor documentation fix suggested below.
Co-authored-by: openhands <openhands@all-hands.dev>
enyst
left a comment
There was a problem hiding this comment.
Hi — OpenHands-GPT-5.4 here. I read the PR, the review threads, the related issues (#2228, #2274, #1451), and I also checked the current usage patterns in OpenHands/OpenHands-CLI before leaving this review.
I agree with the short-term motivation: programmatic settings should come from the SDK instead of being hand-curated separately in each client. I also think replacing the duplicate mini-LLM settings subset with the canonical LLM fields was the right local correction.
That said, I don't think this PR lands on the right boundary for the SDK yet.
-
The new AgentSettings round-trip is lossy.
from_agent()/apply_to_agent()read like a general SDK config/edit/rebuild path, but the implementation only preserves a curated default story (LLMSummarizingCondenser,APIBasedCritic, and an annotated subset of LLM fields). In an extensible SDK, an official settings/materialization path should not silently drop alternative built-in or downstream implementations. -
The exported schema mixes semantic config with client presentation policy.
widget,advanced,placeholder,slash_command, and similar hints are first-party UX decisions, not core SDK semantics. Exporting them from SDK models hardcodes one client opinion into every client and makes future divergence painful. -
More broadly, #2274 is right that
LLMalready carries too many responsibilities. This PR adds more meaning onto the currentLLMclass instead of separating configuration from runtime/materialization.
My preference would be either:
- narrow this into an explicitly first-party client adapter (instead of a generic SDK settings abstraction), or
- redesign around a canonical immutable config/profile object with neutral schema export, and keep presentation decisions in CLI/GUI.
So: useful motivation, but I think the current abstraction is risky for an extensible SDK.
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
Summary
AgentSettingsandexport_settings_schema()for downstream clientsLLMsettings surface in the exported schema instead of a curated five-field subsetfrom_agent()/apply_to_agent()/to_agent()round-trip path so this PR stays focused on schema export rather than materializing a default-only SDK config APIChecklist
Testing
uv run pre-commit run --files AGENTS.md openhands-sdk/openhands/sdk/__init__.py openhands-sdk/openhands/sdk/llm/llm.py openhands-sdk/openhands/sdk/settings.py openhands-sdk/openhands/sdk/settings_metadata.py tests/sdk/test_settings.pyuv run pytest tests/sdk/test_settings.py -qFixes
Fixes #2228
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:ae37726-pythonRun
All tags pushed for this build
About Multi-Architecture Support
ae37726-python) is a multi-arch manifest supporting both amd64 and arm64ae37726-python-amd64) are also available if needed