Skip to content

stores: persist only non-default agent settings#549

Draft
enyst wants to merge 2 commits intomainfrom
openhands/agent-settings-non-default
Draft

stores: persist only non-default agent settings#549
enyst wants to merge 2 commits intomainfrom
openhands/agent-settings-non-default

Conversation

@enyst
Copy link
Collaborator

@enyst enyst commented Feb 27, 2026

Summary

  • Switch agent_settings.json persistence to a CLI-owned, versioned schema instead of dumping the full SDK Agent model.
  • Persist only user-facing fields (model, api_key, optional base_url, and memory_condensation_enabled when non-default) and reconstruct a runtime Agent using current SDK + CLI defaults.
  • Maintain backwards compatibility by loading legacy full-Agent dumps and migrating them in-place.

Why

Storing a full Agent snapshot pins SDK defaults and makes saved configs large and brittle across SDK releases. Persisting only explicit overrides keeps configs smaller and allows defaults to evolve safely.

Testing

  • make format
  • make lint
  • make test

Fixes #302


🚀 Try this PR

uvx --python 3.12 git+https://github.com/OpenHands/OpenHands-CLI.git@openhands/agent-settings-non-default

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

Coverage

Coverage Report •
FileStmtsMissCoverMissing
openhands_cli/stores
   agent_store.py2252190%106, 124, 127, 166, 308, 363–364, 367, 392, 563–564, 566, 573, 580, 582, 591, 594–595, 598–599, 601
TOTAL655291186% 

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.

Update agent_settings handling to only persist non-default fields

2 participants