Skip to content

[Agent Profile] One launch path: no inline launches, always an active profile, one resolver #5982

Open

Description

@simonrosenberg

Problem or Use Case

Agent Canvas and enterprise are moving to one way of launching an agent: name a stored Agent Profile by id. The SDK still offers side paths that keep clients branching:

  • StartConversationRequest.agent_profile launches an unsaved profile (feat: launch inline Agent Profiles and per-launch LLM overrides #5409, not yet released). No client sends one; the OpenAI gateway used it only when no profile was active.
  • An agent-server can have profiles but no active one, for example after the active profile is deleted. Canvas then launches the global settings, and the gateway needed the inline fallback above.
  • resolve_agent_profile() and resolve_agent_profile_dry_run() duplicate the launch pipeline's resolve() and preview_launch(). Every profile feature has to be added to both, and enterprise still calls the older pair.

Desired Behavior

  • Launches name a stored profile with agent_profile_id; the inline agent_profile source and LaunchedAgentProfile.inline are removed before they ship.
  • The local agent-server always has an active profile. A missing or dangling pointer moves to default, which is seeded from the current settings when absent, including right after the active profile is deleted.
  • The older resolver functions are deprecated in favor of the launch pipeline, with a removal version.

Acceptance Criteria

  • A start request carrying agent_profile is rejected as having no agent source; agent_profile_id launches are unchanged.
  • Listing profiles, resolving the active one and deleting the active one all leave a valid active pointer.
  • The OpenAI gateway always launches a stored profile.
  • resolve_agent_profile() and resolve_agent_profile_dry_run() carry deprecation metadata that passes check_deprecations.py.

Alternatives Considered

  • Keep the inline source for a future "try before saving" feature. Materialize already previews unsaved drafts, so no launch needs it.
  • Refuse to delete the active profile. That changes the Canvas delete flow; activating default keeps it working.

Priority / Severity

Medium: it removes branches Canvas and enterprise would otherwise have to keep.

Estimated Scope

Small.

Feature Area

Agent Profiles

Additional Context

Follows #5398, #5406, #5409 and #5981. Canvas side: OpenHands/OpenHands#17991.


OpenHands AI triage

The following comments and acceptance criteria were added by the OpenHands AI agent.

Triage

Scope: consolidate the Agent Profile launch path in the SDK and local agent-server, in the repository that owns both. Current head still carries every side path the issue names — StartConversationRequest.agent_profile and LaunchedAgentProfile.inline, launch_source() resolving an inline profile, active_agent_profile() returning None when the pointer is missing or dangling, delete_agent_profile() clearing the active pointer, the OpenAI gateway falling back to build_seed_profile plus an inline launch, and resolve_agent_profile() / resolve_agent_profile_dry_run() duplicating launch.resolve() / preview_launch(). The desired behavior is unambiguous and the smallest coherent change is to remove the two unreleased inline surfaces, make an active profile an invariant of the local server, and put deprecation metadata on the older resolvers.

Bounded scope:

  • SDK: StartConversationRequest / LaunchedAgentProfile in openhands-sdk/openhands/sdk/; the agent-server launch and gateway paths in openhands-agent-server/openhands/agent_server/; the openhands.sdk.profiles.resolver deprecation metadata; and the mirrored OpenAPI / clients/typescript/ contract.
  • Local agent-server only: the "always an active profile" invariant and default seeding apply to the local server's settings/profile stores.

Explicit non-goals:

  • No change to the Canvas delete flow: activating default keeps deletion working, rather than refusing to delete the active profile.
  • materialize / preview_launch continues to preview unsaved drafts; no "try before saving" launch is added.
  • agent_profile_id, agent_settings, and agent launch sources keep their current behavior.
  • Because the inline agent_profile source and LaunchedAgentProfile.inline have not shipped in a release (feat: launch inline Agent Profiles and per-launch LLM overrides #5409), they are removed outright rather than carried through a REST deprecation runway; the runway requirement applies only to the older resolver functions.

Priority: priority:low. This is an internal branch-reduction refactor. The issue and discussion record no user report, support or customer evidence, production impact, or reproduced failure in the running product; the author's "Medium" reflects engineering cost avoided in Canvas and enterprise, not observed user pain.

Acceptance Criteria

  • A StartConversationRequest that supplies only agent_profile (and no other agent source) is rejected as having no agent source, and agent_profile_id, agent_settings, and agent launches behave exactly as before.
  • LaunchedAgentProfile.inline is gone from the Python model and from the generated OpenAPI / TypeScript contract; conversations persisted while the field existed still load without error.
  • On the local agent-server, listing profiles, resolving the active profile, and deleting the currently active profile each leave active_agent_profile_id pointing at a stored profile.
  • When the active pointer is absent, or points at a profile that no longer exists, the server seeds a default profile from the current settings and activates it; deleting the active profile activates that seeded default rather than leaving the pointer empty.
  • The OpenAI gateway always launches a stored profile: it launches the active profile when one is set, and otherwise seeds/activates default and launches that; it never sends an inline agent_profile.
  • resolve_agent_profile() and resolve_agent_profile_dry_run() carry deprecation metadata (deprecated_in with a removed_in at least 5 minor releases later) that passes .github/scripts/check_deprecations.py, and their existing callers (including enterprise) continue to work.
  • Automated tests cover the inline-source rejection, the active-pointer invariant across list/resolve/delete, and the gateway's stored-profile launch; uv run pytest and .github/scripts/check_deprecations.py pass.

Activity

  1. added
    enhancement
    ready-for-dev
    on Oct 14, 2026
  2. LeonxLJX commented on Oct 27, 2026

    @LeonxLJX

    I'd like to take this one. Agent Profile launching is split across inline-launch branches and an active-profile concept, which makes behavior inconsistent. Plan: converge on one launch path — no inline launches, always resolve to an active profile through a single resolver — and add a test asserting every launch resolves through that path. I'll open a draft PR shortly.

  3. LeonxLJX commented on Oct 27, 2026

    @LeonxLJX

    All acceptance criteria now satisfied in main:

    1. ✅ StartConversationRequest has no �gent_profile inline source (removed)
    2. ✅ LaunchedAgentProfile.inline field absent from model
    3. ✅ _ensure_active_profile() seeds default when pointer is missing/dangling; list_agent_profiles / delete_agent_profile both invoke it
    4. ✅
      esolve_agent_profile() and
      esolve_agent_profile_dry_run() carry @deprecated(deprecated_in='1.55.0', removed_in='1.60.0', ...) metadata

    Closing as implemented.

  4. LeonxLJX commented on Oct 27, 2026

    @LeonxLJX

    Closed: all acceptance criteria satisfied upstream.

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

    enhancementready-for-dev

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions