Skip to content

settings: generate CLI settings from SDK schema#580

Draft
neubig wants to merge 6 commits intomainfrom
openhands/issue-2228-cli-settings-schema
Draft

settings: generate CLI settings from SDK schema#580
neubig wants to merge 6 commits intomainfrom
openhands/issue-2228-cli-settings-schema

Conversation

@neubig
Copy link
Contributor

@neubig neubig commented Mar 8, 2026

Summary

  • replace the CLI's duplicated settings definitions with schema-driven rendering from AgentSettings.export_schema()
  • generate slash commands and help text from the shared SDK settings metadata instead of hand-maintained CLI definitions
  • point pyproject.toml directly at the software-agent-sdk issue branch so the PR can consume the new schema before a release is cut
  • resolve follow-up review feedback by removing implicit API-key merge-on-save behavior, switching to direct SDK imports, and sharing argument-hint formatting across CLI/ACP settings commands

Dependencies

  • depends on the SDK schema changes in OpenHands/software-agent-sdk
  • installs openhands-sdk, openhands-tools, and openhands-workspace from OpenHands/software-agent-sdk@openhands/issue-2228-sdk-settings-schema

Testing

  • uv run pytest tests/shared/test_settings_commands.py tests/stores/test_programmatic_settings.py tests/acp/test_slash_commands.py -q
  • make lint
  • make test
  • make test-binary

Fixes

Fixes OpenHands/software-agent-sdk#2228


🚀 Try this PR

uvx --python 3.12 git+https://github.com/OpenHands/OpenHands-CLI.git@openhands/issue-2228-cli-settings-schema

Co-authored-by: openhands <openhands@all-hands.dev>
Copy link
Collaborator

@all-hands-bot all-hands-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taste Rating: 🟡 Acceptable - Solves a real problem (settings duplication) with a pragmatic schema-driven approach. Core logic is sound, but there are data ownership concerns and some unnecessary complexity around API key preservation.

Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2026

Coverage

Coverage Report •
FileStmtsMissCoverMissing
openhands_cli/acp_impl
   slash_commands.py68198%57
openhands_cli/acp_impl/agent
   base_agent.py2623287%143, 186, 227, 337–339, 410, 417–418, 423, 444–447, 451–458, 483, 567–568, 571–572, 653, 729–731, 760
   local_agent.py86495%81, 145, 155, 169
   remote_agent.py1486357%85–86, 92–93, 97–98, 102, 104–108, 111–113, 123–124, 127–129, 133–135, 145–146, 161–163, 167, 169–170, 176, 180–181, 183, 192–193, 198–200, 211–212, 217, 219–220, 224, 231–232, 234–235, 238–240, 242, 250, 252–253, 287, 352–354, 360–361
openhands_cli/acp_impl/utils
   mcp.py25484%65–68
openhands_cli/shared
   settings_commands.py1056637%51–53, 55–58, 65–73, 77, 101–108, 112–116, 118–124, 128–132, 136–145, 153–159, 163–169
openhands_cli/stores
   __init__.py40100% 
   programmatic_settings.py370100% 
openhands_cli/tui/core
   commands.py49295%38, 61
openhands_cli/tui/modals/settings/components
   cli_settings_tab.py320100% 
openhands_cli/tui/widgets
   input_area.py802963%75, 77–97, 101–102, 108, 118, 135–136, 152
openhands_cli/tui/widgets/user_input
   input_field.py1721193%288, 303, 306–307, 316–317, 319, 350–351, 372–373
TOTAL6859100985% 

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
@neubig neubig marked this pull request as draft March 9, 2026 03:07
neubig pushed a commit that referenced this pull request Mar 9, 2026
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
@neubig neubig force-pushed the openhands/issue-2228-cli-settings-schema branch from 05e7cda to acb7530 Compare March 9, 2026 18:02
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.

Prepare settings for ingestion to programmatic settings menu in CLI and GUI

3 participants