Repository navigation
Description
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_profilelaunches 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()andresolve_agent_profile_dry_run()duplicate the launch pipeline'sresolve()andpreview_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 inlineagent_profilesource andLaunchedAgentProfile.inlineare 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_profileis rejected as having no agent source;agent_profile_idlaunches 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()andresolve_agent_profile_dry_run()carry deprecation metadata that passescheck_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
defaultkeeps 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/LaunchedAgentProfileinopenhands-sdk/openhands/sdk/; the agent-server launch and gateway paths inopenhands-agent-server/openhands/agent_server/; theopenhands.sdk.profiles.resolverdeprecation metadata; and the mirrored OpenAPI /clients/typescript/contract. - Local agent-server only: the "always an active profile" invariant and
defaultseeding apply to the local server's settings/profile stores.
Explicit non-goals:
- No change to the Canvas delete flow: activating
defaultkeeps deletion working, rather than refusing to delete the active profile. materialize/preview_launchcontinues to preview unsaved drafts; no "try before saving" launch is added.agent_profile_id,agent_settings, andagentlaunch sources keep their current behavior.- Because the inline
agent_profilesource andLaunchedAgentProfile.inlinehave 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
StartConversationRequestthat supplies onlyagent_profile(and no other agent source) is rejected as having no agent source, andagent_profile_id,agent_settings, andagentlaunches behave exactly as before. -
LaunchedAgentProfile.inlineis 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_idpointing at a stored profile. - When the active pointer is absent, or points at a profile that no longer exists, the server seeds a
defaultprofile from the current settings and activates it; deleting the active profile activates that seededdefaultrather 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
defaultand launches that; it never sends an inlineagent_profile. -
resolve_agent_profile()andresolve_agent_profile_dry_run()carry deprecation metadata (deprecated_inwith aremoved_inat 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 pytestand.github/scripts/check_deprecations.pypass.
Activity
LeonxLJX commentedon Oct 27, 2026
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.
LeonxLJX commentedon Oct 27, 2026
All acceptance criteria now satisfied in main:
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.
LeonxLJX commentedon Oct 27, 2026
Closed: all acceptance criteria satisfied upstream.