Skip to content

Conversation

@enyst
Copy link
Collaborator

@enyst enyst commented Oct 18, 2025

Summary

  • integrate LLM profile persistence into LLMRegistry, exposing list/load/save/register/validate helpers with configurable profile directories
  • rename the conversation persistence helpers to resolve_llm_profiles / compact_llm_profiles and update ConversationState to use them
  • keep the SDK UI-agnostic by dropping the agent_settings shim while reusing the shared profile transforms

Testing

  • .venv/bin/python -m pytest tests/sdk/llm/test_llm_registry_profiles.py
  • .venv/bin/python -m pytest tests/sdk/conversation/local/test_state_serialization.py

Agent Server images for this PR

GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server

Variants & Base Images

Variant Base Image Docs / Tags
golang golang:1.21-bookworm Link
java eclipse-temurin:17-jdk Link
python nikolaik/python-nodejs:python3.12-nodejs22 Link

Pull (multi-arch manifest)

docker pull ghcr.io/openhands/agent-server:b30b93f-python

Run

docker run -it --rm \
  -p 8000:8000 \
  --name agent-server-b30b93f-python \
  ghcr.io/openhands/agent-server:b30b93f-python

All tags pushed for this build

ghcr.io/openhands/agent-server:b30b93f-golang
ghcr.io/openhands/agent-server:v1.0.0a4_golang_tag_1.21-bookworm_binary
ghcr.io/openhands/agent-server:b30b93f-java
ghcr.io/openhands/agent-server:v1.0.0a4_eclipse-temurin_tag_17-jdk_binary
ghcr.io/openhands/agent-server:b30b93f-python
ghcr.io/openhands/agent-server:v1.0.0a4_nikolaik_s_python-nodejs_tag_python3.12-nodejs22_binary

The b30b93f tag is a multi-arch manifest (amd64/arm64); your client pulls the right arch automatically.

@enyst enyst marked this pull request as draft October 18, 2025 14:10
@enyst enyst changed the title feat(llm): add ProfileManager and eager profile registration feat(llm): add LLM profiles Oct 18, 2025
…sation startup\n\n- ProfileManager manages ~/.openhands/llm-profiles/*.json (load/save/list/register)\n- LocalConversation now calls ProfileManager.register_all to eagerly populate LLMRegistry\n\nCo-authored-by: openhands <[email protected]>
@enyst enyst force-pushed the agent-sdk-18-profile-manager branch from 4169ded to 46ca1b7 Compare October 18, 2025 14:19
@enyst enyst force-pushed the agent-sdk-18-profile-manager branch from 1b4ece7 to 9cbf67f Compare October 18, 2025 17:12
enyst and others added 14 commits October 18, 2025 22:01
- embed profile lifecycle APIs into the registry
- update persistence helpers, docs, and examples to use registry
- replace profile manager tests with registry profile coverage

Co-authored-by: openhands <[email protected]>
- note that LLMRegistry is the unified entry point for disk and runtime profiles
- mention how to override the profile directory when embedding the SDK

Co-authored-by: openhands <[email protected]>
- rename payload helpers to resolve_llm_profiles/compact_llm_profiles
- update conversation state to use clearer helper names
- drop the optional agent_settings convenience module and its tests

Co-authored-by: openhands <[email protected]>
- replace the _transform flag with dedicated _compact/_resolve helpers
- make compact_llm_profiles/resolve_llm_profiles easier to follow by delegating to the new helpers

Co-authored-by: openhands <[email protected]>
enyst added 2 commits October 21, 2025 22:07
Bring in new package layout and port LLM profile switching support.
Revert the in-progress switch_llm helpers and tests; agent-sdk-18 branch now only contains LLM profile persistence.
@OpenHands OpenHands deleted a comment from openhands-ai bot Oct 21, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 21, 2025

Coverage

Coverage Report •
FileStmtsMissCoverMissing
openhands-sdk/openhands/sdk/agent
   base.py1621690%145, 151, 169–171, 220, 228–229, 260, 306, 313, 327, 364–365, 375–376
openhands-sdk/openhands/sdk/conversation
   state.py1683380%195, 200–202, 204–205, 211, 236, 281–283, 299–300, 329, 347, 356, 371, 377, 385, 397–410
openhands-sdk/openhands/sdk/conversation/impl
   local_conversation.py1634572%132–133, 138–139, 159, 164, 176, 193, 201–203, 207–208, 258–260, 267, 286–287, 289, 303, 305, 307, 311, 313–315, 317, 319, 325–326, 339–340, 342, 344, 348–351, 373, 375–377, 394, 396
openhands-sdk/openhands/sdk/llm
   llm.py47118460%300, 311, 321, 329, 334–338, 340–341, 348–349, 353–357, 360, 365, 369, 381, 385–387, 391–392, 403, 405, 409, 426, 460, 465, 469, 474, 485, 501, 522, 526, 541, 547–548, 567–568, 576, 601–603, 624–625, 628, 632, 644, 649–652, 659, 662, 670–675, 678, 693, 697–699, 701–702, 707–708, 710, 717, 720–722, 784–787, 792–797, 801–802, 811–813, 816–817, 854–855, 901, 921, 956, 972, 975–977, 980–988, 992–994, 997, 1000–1002, 1009–1010, 1019, 1026–1028, 1032, 1034–1039, 1041–1058, 1061–1065, 1067–1068, 1074–1083, 1096, 1110, 1115, 1129–1130, 1135–1136, 1140, 1142, 1151–1152, 1156, 1161–1162, 1167
   llm_registry.py1226348%90–91, 97, 113, 118, 127–132, 135, 148–149, 154–157, 164–166, 170–173, 175–178, 185–189, 191–195, 197–200, 205–212, 214–216, 244–247, 261–262, 267, 270, 275
TOTAL10770473856% 

enyst added 4 commits October 21, 2025 22:44
Example 25 now performs a read/write/delete workflow and verifies the persisted profile reference.
- move inline/profile compaction into LLM serializer/validator
- use model_dump_json context in ConversationState persistence
- add persistence settings module and cover profile reference tests
- document persistence comparison and recommendations
@enyst enyst force-pushed the agent-sdk-18-profile-manager branch from b4b5199 to 75e8ecd Compare October 23, 2025 10:32
@blacksmith-sh
Copy link
Contributor

blacksmith-sh bot commented Nov 2, 2025

[Automatic Post]: It has been a while since there was any activity on this PR. @enyst, are you still working on it? If so, please go ahead, if not then please request review, close it, or request that someone else follow up.

@openhands-ai
Copy link

openhands-ai bot commented Nov 6, 2025

Looks like there are a few issues preventing this PR from being merged!

  • GitHub Actions are failing:
    • Pre-commit checks
    • Run tests
    • Check Documented Examples
    • Agent Server

If you'd like me to help, just leave a comment, like

@OpenHands please fix the failing actions on PR #795 at branch `agent-sdk-18-profile-manager`

Feel free to include any additional details that might help me get this PR into a better state.

You can manage your notification settings

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