Skip to content

Stop reading ACPAgentSettings.llm before bumping to openhands-sdk 1.56.0 #613

Closed

Description

@simonrosenberg

Why

openhands-sdk deprecates ACPAgentSettings.llm in 1.51.0 and deletes it in 1.56.0 (OpenHands/software-agent-sdk#5434, OpenHands/software-agent-sdk#5432). Enterprise is pinned to 1.49.6 today, so nothing breaks yet. But several places read the field without checking the agent kind.

From SDK 1.51.0:

  • create_agent() ignores the field and never serializes it.
  • Reading it emits a DeprecationWarning; passing it emits a DeprecatedWarning.
  • The agent-settings v6→v7 migration drops any stored ACP llm, including keys copied in by profile switching. Enterprise runs that migration through validate_agent_settings.
  • ACP conversations no longer call a provider to generate titles.

At SDK 1.56.0 the field is gone, so each read below raises AttributeError for ACP users. That covers GET /api/v1/settings, settings saves and profile switches.

What to change

Line numbers are on main at bf4139fb6.

  • Delete the ACP llm strip. It's at openhands/app_server/app_conversation/live_status_app_conversation_service.py:2601: 'llm': acp_settings.llm.model_copy(update={'api_key': None, 'base_url': None}). It does nothing from 1.51.
  • Move the log-only read under the OpenHands branch. live_status_app_conversation_service.py:2114 does getattr(user.agent_settings, 'llm', None) before the ACP branch at :2133. It survives 1.56 but warns from 1.51.
  • Return False from llm_api_key_is_set for ACP settings. It's at openhands/app_server/settings/settings_models.py:821. The SDK agent-server does the same since fix(settings): deprecate ACPAgentSettings.llm so ACP agents keep their metrics LLM software-agent-sdk#5434.
  • Gate the GET-settings reads on the agent kind. openhands/app_server/settings/settings_router.py:282 and :293 read agent_settings.llm and resp_llm.
  • Gate the managed-key rotation on OpenHands settings. At settings_router.py:408-410 and :785-787, _maybe_rotate_stale_managed_key(settings.agent_settings.llm, ...) and object.__setattr__(settings.agent_settings, 'llm', rotated) run for every kind. _post_merge_llm_fixups just above already checks the kind.
  • Profile switch: skip the llm write for ACP settings.
    • switch_to_profile (settings_models.py:996-1007) writes the profile LLM into agent_settings for every kind, and settings_router.py:794 returns settings.agent_settings.llm.model.
    • For ACP, still record llm_profiles.active but don't write llm. The SDK's /api/profiles/{name}/activate now returns llm_applied: false here.
  • Profile save: require an explicit llm for ACP settings, or reject it. settings_router.py:702 snapshots agent_settings.llm when the request has no llm. On ACP settings that's the SDK default LLM with no key.
  • Add a regression test. Use ACP settings for GET /api/v1/settings, a settings save and a profile switch, with ACPAgentSettings.llm warnings turned into errors (for example -W "error:ACPAgentSettings.llm").

These are already fine:

  • sync_active_profile_from_settings (settings_models.py:841) and _post_merge_llm_fixups (settings_router.py:132) check the kind.
  • _configure_llm runs only on the OpenHands path.
  • file_settings_store.py:28 reads the raw dict, and the v7 migration means ACP payloads no longer carry llm.

When

The deprecation warnings appear with the bump to SDK ≥1.51.0, so do this then if possible. It must be done before bumping to SDK 1.56.0.

This issue was drafted by an AI agent (Claude Code) on behalf of the requesting user.

Activity

  1. added
    type: chore
    on Oct 1, 2026
  2. simonrosenberg commented on Oct 2, 2026

    @simonrosenberg
    MemberAuthor

    The one existing test that already fails with this behavior on SDK main, test_saas_settings_store.py::test_store_agent_kind_switch_stays_scoped_to_acting_member, is updated in #453 (7103618e6). The code items above are still open.

  3. simonrosenberg commented on Oct 13, 2026

    @simonrosenberg
    MemberAuthor

    The conversation-launch portion is addressed in #763: the ACP no-op LLM strip is removed and the diagnostic LLM read is gated on OpenHands settings. The other settings/router/profile-switch acceptance items remain open; #763 pins released SDK 1.54.0, before the field removal. Keeping this issue open for that separate forward-compatibility work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: chore

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions