Skip to content

Automation runs launch from the selected agent profile, via plugin specs (local and OHE) #600

Open
0 of 3 issues completed

Description

@simonrosenberg

Problem

Automation runs don't use the agent profile the user selected. A profile with sub-agents enabled runs without the task tool, and nothing reports it (#557; repro on OHE Replicated 0.81: #557 (comment)).

  • Prompt and plugin presets. Today's "Create Automation → enter a prompt" builds its own agent with get_default_agent(...) and never reads the profile.
  • Plugin-spec automations. These (POST /v1/plugin-spec, feat: add plugin-backed executable automations #580, automation 1.21.0+) are becoming the way to define automations, and the presets may be deprecated. Their conversation runner does launch by agent_profile_id, which works locally, but:
    1. On OHE the runner sends the id to the sandbox's own agent-server, which can't resolve enterprise profiles ([Feature]: Create plugin-spec conversations from the agent profile at dispatch (local and OHE) #601).
    2. The manifest's runtime.agent_profile.default_name fixes the profile; the user can't choose it when creating the automation.
    3. A typed prompt can't be expressed, because the runner's prompt is /{plugin}:{command} {arguments} from the manifest.
    4. Nothing in Canvas (through 1.28.0) creates plugin-spec automations (Discussion: one-click launch share experience for plugin-based automations (demo options) #609). The API itself is deployed on Beta and in OHE 0.82.0+ (automation 1.21.0), but not yet on SaaS (automation 1.19.1).
    5. On OHE, enterprise doesn't honor a profile's tools or secret_refs, so the manifest's allowlists ("all and only these tools / secrets") aren't enforced there.

Reproduced on Beta (2026-10-19; automation 1.21.0, agent-server 1.55.1). The test used a profile whose tools include task_tool_set, set as the active profile. All test data was removed afterwards.

Launch Tools the agent got Profile recorded
Interactive conversation from the profile (control) terminal, file_editor, task_tracker, browser_tool_set, task_tool_set launched_agent_profile = the profile
Prompt-preset automation created while the profile was active, dispatched manually terminal, file_editor, task_tracker, FinishTool automation agent_profile_id: null; no profile tag on the conversation
  • Passing agent_profile_id to POST /v1/preset/prompt returns 422 extra_forbidden.
  • Inside the run's sandbox, the plugin-spec runner's launch (POST /api/conversations with the enterprise profile id) returns 404 Agent profile with id '…' not found. That agent-server's profile store holds only its own default profile. This is item 1 above, observed directly.

Proposed solution

Make plugin-spec conversation runs the single path for profile-based automations, launching from the selected profile on both backends. The presets are frozen, not fixed.

  1. The service creates the run's conversation at dispatch; the runner attaches. Once the sandbox is ready, the dispatcher asks the profile's owner for the conversation and passes its id to the runner (AUTOMATION_CONVERSATION_ID).
    • Local: agent-server POST /api/conversations with agent_profile_id, plugins and the run's tags.
    • OHE/Cloud: enterprise POST /api/v1/app-conversations with the run's sandbox_id, agent_profile_id, plugins, tags and trigger: automation. These are all fields it already accepts.
    • Check: if the conversation's launched_agent_profile isn't the requested profile, the run fails.
    • Runner: it attaches, sends the prompt with its event context, waits and reports as today.
  2. Users choose the profile. POST /v1/plugin-spec accepts an optional agent_profile_id, checked against the manifest's allowlists. Without it, the manifest's default_name applies, as today.
  3. Prompts become plugin specs. A stock conversation plugin runs a prompt supplied per automation, for example entrypoint.arguments rendered from config. "Create Automation → enter a prompt" then creates a plugin-spec automation on the chosen profile, defaulting to the user's active one.
  4. Canvas creates plugin-spec automations for both the prompt flow and catalog plugins, with a profile picker. The launch experience is discussed in Discussion: one-click launch share experience for plugin-based automations (demo options) #609.

Dependencies:

Verified contracts

Checked on 2026-10-19 against SDK 1.56.0, enterprise main 2a5b01315 (1.72.1, SDK 1.55.1; profile and launch code unchanged since 1.71.0), Canvas main d01d491d1b and 1.28.0, and automation main b6fa62d (1.22.0).

Deployed versions:

Deployment enterprise agent-server automation Canvas
OHE 0.81.0 (Raj's report) 1.71.0 1.50.1 1.19.1 1.27.1
OHE 0.82.0 1.72.0 1.55.1 1.21.0 1.27.1
OHE 0.83.0 (latest) 1.72.1 1.55.1 1.21.0 1.28.0
Beta not checked 1.55.1 1.21.0 not checked
SaaS not checked not checked 1.19.1 not checked
Area What the code does today
Plugin-spec automations (automation 1.22.0) The manifest is the automation block of .plugin/plugin.json, or automation-plugin.json. Specifically:
• It declares the entrypoint (script or conversation runner), a config schema, the required agent/LLM profile default_name, and optional exact allowlists for tools, MCP refs and secret refs.
• Create resolves the profile name to an id through the owner's /api/agent-profiles and checks the allowlists. Dispatch re-checks them against the stored agent_profile_id, which PATCH can change.
• The create request has no profile field, and the agent profile owns the model.
• The conversation runner launches with RemoteConversation.create(StartConversationRequest(agent_profile_id=…, plugins=…)) on its workspace's agent-server.
• It has no finish hook, prepares nothing before creating the conversation, and injects get_secrets(agent_profile_id=…) afterwards. Enterprise ignores that parameter.
Local agent-server (SDK 1.56.0) POST /api/conversations takes exactly one agent source: agent, agent_settings or agent_profile_id. A profile launch also honors plugins, initial_message, tags, secrets, hook_config and launch additions. Profiles resolve only from the server's own store, and an unknown id returns 404.
Enterprise conversation start (POST /api/v1/app-conversations) Accepts agent_profile_id, sandbox_id (a sandbox the caller owns), initial_message, plugins, one selected_repository, llm_model, secrets, tags, trigger, processors and client_tools. Any user API key can call it, including the keys the automation service mints.
Enterprise profile handling Still uses the older resolve_agent_profile path and sends a fully built agent to the sandbox. Specifically:
• The profile's tools are replaced by get_default_tools(enable_sub_agents=…), which includes the browser.
• The profile's prompt suffix is dropped.
• secret_refs is not applied.
• An unknown or other-org profile id falls back to composed settings (enterprise#759). When a profile resolves, enterprise stamps agentprofileid and revision tags, surfaced as launched_agent_profile.
• Profiles are org-scoped; personal profiles are in open PRs #753–#755.
• enterprise#763 (open) moves this onto the SDK launch pipeline.
OHE sandbox No copy of agent profiles, so the sandbox's agent-server cannot resolve an enterprise profile id.
Canvas (1.28.0 and main) Hides the profile tools editor on cloud. No UI creates plugin-spec automations. The create panel's profile pill on prompt and plugin presets triggers a 422 (OpenHands/OpenHands#18569).
Automation service One execution backend per mode: LocalAgentServerBackend and CloudSandboxBackend. In cloud mode it mints the user's API key and creates sandboxes through enterprise. The dispatcher already exports AUTOMATION_CONVERSATION_ID for subject-based runs.

Design

1. Dispatch-time conversation creation.

  • After get_execution_context, plugin-spec conversation runs call a new backend method, create_conversation:
    • LocalAgentServerBackend: POST /api/conversations on the configured agent-server.
    • CloudSandboxBackend: POST /api/v1/app-conversations with the run's sandbox_id and the minted user key, then poll the start task for the conversation id.
  • Follow-up runs (continue_conversation) reuse the subject's conversation when it exists.
  • The provenance check runs before the runner starts, so a mismatch fails the run without executing any script.
  • The runner replaces RemoteConversation.create(...) with RemoteConversation.attach(workspace, AUTOMATION_CONVERSATION_ID). It keeps the event-context prompt, send_message, run and /complete.
  • Secrets: on OHE they come from enterprise's start. Locally the runner keeps injecting the profile-scoped secrets as today.
  • Why at dispatch rather than requested by the runner: the runner prepares nothing before creation, so failures surface before anything runs, and the runner needs neither the profile id nor access to enterprise.

2. Profile selection. POST /v1/plugin-spec takes an optional agent_profile_id, validated by the existing validate_agent_profile_allowlists. Dispatch already uses the stored id. Canvas defaults the picker to the user's active profile, recorded at creation.

3. Prompts as plugin specs. The prompt flow needs a stock conversation plugin and a per-automation prompt. Two options:

4. Presets frozen.

5. Parked.

Alternatives considered

A. Fix the presets instead. This was the previous scope of this issue: the service creates the conversation for prompt and plugin presets too.

B. The runner requests the conversation from the service (POST /v1/runs/{run_id}/conversation), as in the previous version.

  • For: the runner could prepare the workspace first.
  • Against: plugin-spec runs prepare nothing before creation, so it's an extra endpoint and round trip for no gain.

C. The runner calls the profile owner directly.

  • For: no change in the service.
  • Against: every runner needs mode branching and enterprise API knowledge, and starts conversations with the user key held in the sandbox.

D. The service drives the whole run over the API, with no runner.

  • For: no per-run SDK install in the sandbox.
  • Against: completion, the watchdog and progress reporting assume a process inside the sandbox. It remains a possible later simplification.

Known OHE limitations

Until OpenHands/enterprise#763 lands, plugin-spec allowlists aren't enforced on OHE:

  • the run gets enterprise's default tools, including the browser, plus task when sub-agents are enabled;
  • secrets aren't scoped by the profile;
  • the profile's prompt suffix is dropped.

#763 is needed before OHE can promise the allowlists. It is not needed for #557: the run still gets task when the profile includes task_tool_set.

Decisions (agreed with @simonrosenberg, 2026-10-19)

  1. Plugin-spec conversation runs are the path for profile-based automations. The presets are frozen, not fixed.
  2. The service creates the run's conversation at dispatch through its per-mode backend, and the runner attaches.
  3. A provenance check fails the run when the launched profile differs from the requested one.
  4. POST /v1/plugin-spec accepts an optional user-chosen agent_profile_id within the manifest's allowlists.
  5. A typed prompt becomes a plugin-spec automation through a stock conversation plugin.
  6. The finish requirement (structured outcome) and the LLM override are parked.

Work breakdown

Piece Repo Tracking
Dispatch-time conversation creation per backend, provenance check, runner attaches automation #601: #614 (draft; cloud path not yet run on Beta)
Optional agent_profile_id on POST /v1/plugin-spec automation this issue: #615 (draft, stacked on #614)
Stock prompt plugin and a per-automation prompt automation, extensions this issue: #615 (entrypoint.arguments from config), OpenHands/extensions#799 (prompt-task)
Canvas creates plugin-spec automations (prompt flow and catalog) with a profile picker OpenHands (Canvas) #609 (discussion); no issue yet
Hide the preset profile pill until presets are deprecated OpenHands (Canvas) OpenHands/OpenHands#18569: OpenHands/OpenHands#18708 (draft)
Honor profile tools and secret_refs; fail closed enterprise OpenHands/enterprise#763, OpenHands/enterprise#759
Tools editor on cloud OpenHands (Canvas) OpenHands/OpenHands#18656
Every user has a usable profile (seeding) enterprise, SDK #609; OpenHands/software-agent-sdk#5982 (local)
Profile-scoped secrets at the worker boundary enterprise OpenHands/enterprise#854
MCP in automation runs automation #93
Deploy plugin specs to SaaS (already on Beta and OHE 0.82.0+) automation SaaS deploy
Ship the changes above automation, OpenHands-Cloud automation release, chart bump
Preset bug (closes when the prompt flow moves) automation #557
Parked: finish policy, finish schema, enterprise start fields automation, SDK, enterprise #457, OpenHands/software-agent-sdk#6080, OpenHands/enterprise#868

Rollout order:

  1. OHE first, since that is where Prompt and plugin presets ignore the selected agent profile at run time #557 happens; local plugin-spec runs already launch from the profile. It needs feat: copy the run's agent profile into its cloud sandbox #614, feat: let users choose an automation's agent profile #615 and feat(plugins): add prompt-task, the stock plugin for prompt automations extensions#799 in an automation release, bumped in the OpenHands-Cloud chart. Until Canvas creates plugin-spec automations (Discussion: one-click launch share experience for plugin-based automations (demo options) #609), the prompt flow is reachable through POST /v1/plugin-spec with prompt-task.
  2. fix(agent-profiles): align Enterprise launches with the SDK enterprise#763 afterwards, for the allowlists.
  3. The same release covers local, where the only change is profile choice.

Acceptance Criteria

  • Local run: a plugin-spec conversation run reports launched_agent_profile equal to its profile. The model is offered that profile's tools, including task when the profile has delegation tools, verified by recording the tools sent to the model.
  • OHE run: the same holds through enterprise's conversation start for the run's sandbox, including task when the profile has delegation tools.
  • OHE allowlists: the model is offered exactly the allowlisted tools (after fix(agent-profiles): align Enterprise launches with the SDK enterprise#763).
  • Profile mismatch: when the launched profile differs from the requested one, the run fails with a visible error before the runner starts.
  • Profile choice: POST /v1/plugin-spec accepts an optional agent_profile_id within the manifest's allowlists and rejects one outside them.
  • Prompt flow: "Create Automation → enter a prompt" creates a plugin-spec automation that runs the typed prompt on the chosen profile.
  • Runner: it no longer creates conversations itself or passes agent_profile_id to endpoints that ignore it.
  • Release: shipped in an automation release, deployed to SaaS/Beta, and bumped in the OpenHands-Cloud chart.

Revision history

  • First version: the service drives runs over the API; the automation's extras become launch additions.
  • Second version, after re-checking the code: the script calls the profile owner directly and attaches; enterprise's fallback and fidelity gaps were recorded.
  • Third version: the service creates the conversation on the script's request and fails closed with a provenance check. Corrected that enterprise's llm_model can't carry an LLM profile.
  • Fourth version (this one):
    • Re-scoped to plugin-spec automations, since presets may be deprecated.
    • The conversation is created at dispatch, because plugin-spec runners prepare nothing beforehand.
    • Users can choose the profile, and prompts become plugin specs.
    • The finish requirement and LLM override are parked.
    • fix(agent-profiles): align Enterprise launches with the SDK enterprise#763 is a hard dependency for OHE.
  • 2026-10-19 update:
    • Reproduced on Beta.
    • Plugin specs are deployed on Beta and in OHE 0.82.0+.
    • Added the deployed versions for OHE 0.82.0 and 0.83.0.
  • 2026-10-20 update:

Sub-issues

Sub-issues

0 of 3 Issues completed
Loading 3 sub-issues

Activity

  1. added
    enhancement
    on Oct 19, 2026
  2. all-hands-bot commented on Oct 19, 2026

    @all-hands-bot
    Contributor

    The following comments were added by the OpenHands AI agent.

    Decision needed

    This is the cross-repo design and tracking issue for launching prompt and plugin preset runs from a stored agent profile. Repository guidance treats unresolved design questions as not ready for development, and the issue itself lists three decisions "to confirm" in its ### Decisions to confirm section, so scope and acceptance criteria cannot be finalized yet. Please answer:

    1. "Active profile" semantics for an automation with no pinned profile: does creating with "Active profile" snapshot the profile active at creation time (as resolve_model_profile_for_user already does for model profiles) and store it on the automation, or does each run resolve the user's active profile at run time? The issue marks the snapshot option "Needs confirmation."
    2. Where the run driver lives: does a preset keep an in-sandbox driver that only attaches to a conversation launched by the profile owner, or does the automation service drive the launched conversation over the API, send the task, and watch for completion?
    3. How each backend's launch request carries multi-repo checkout and plugin loading (enterprise app-conversation start vs the local agent-server profile launch).
  3. added
    needs-canvas-release
    needs-sdk-release
    priority:medium
    and removed
    priority:medium
    on Oct 19, 2026
  4. simonrosenberg commented on Oct 19, 2026

    @simonrosenberg
    MemberAuthor

    Superseded: decisions 1–3 were revised on 2026-10-19 after re-checking the code. See #600 (comment) and the issue body.

    I'm an AI agent (Claude Code) helping @simonrosenberg. All three open decisions are settled. The issue body now has a Decisions section, and the design, work breakdown and acceptance criteria are updated to match.

    1. "Active profile" is recorded at creation. Creating or updating with it stores the then-active profile id, matching resolve_model_profile_for_user for model profiles. Edits to that profile still apply. Each run records the profile id and revision, and a missing profile fails visibly. Automations with no stored profile keep today's behavior.
    2. The service drives prompt and plugin runs over the launch API. No preset script and no per-run SDK install. Completion comes through a callback (an enterprise callback processor in OHE) or polling. Custom-code automations keep their script. An in-sandbox driver using sandbox_id is only a fallback if a fix has to ship first.
    3. Context travels in native launch fields. The event payload and follow-ups go in the initial message, plugins in plugins, and repositories in the launch request. Multi-repo needs enterprise's start request to accept a list (added to the work breakdown, no issue yet).
  5. simonrosenberg commented on Oct 19, 2026

    @simonrosenberg
    MemberAuthor

    I'm an AI agent (Claude Code) helping @simonrosenberg. I re-checked every contract on the latest code (SDK main 3f3294581e, enterprise main 95693e3264, Canvas main 79abd32d85, automation 1.21.0) and rewrote the issue body. The main changes:

    • Enterprise doesn't fully apply profiles today.
    • Decision 2 revised. A thin driver inside the sandbox asks the profile owner to start the conversation, then attaches to it: the agent-server's agent_profile_id launch locally, enterprise's conversation start with the run's sandbox_id on OHE. This replaces the service driving runs over the API, and the run lifecycle stays as it is.
    • Decision 1 refined. An automation with no stored profile launches like an interactive conversation with no profile, which covers enable_sub_agents in OHE agent settings, rather than with today's default agent.
    • Decision 3 simplified. The driver keeps cloning repositories.
    • LLM profiles move onto the same launch as its LLM override.
    • Finish policy. It goes through hook_config (already a request field locally; enterprise must forward it) plus a narrow typed finish-schema launch option, with a client-tool fallback.
    • New gap. The plugin_spec runner (feat: add plugin-backed executable automations #580) launches by profile on the sandbox's own agent-server, which can't resolve enterprise profiles.
  6. simonrosenberg commented on Oct 19, 2026

    @simonrosenberg
    MemberAuthor

    I'm an AI agent (Claude Code) helping @simonrosenberg. I updated the issue body to the third version of the design:

  7. changed the title [-]Launch prompt and plugin automation runs from the selected agent profile (local and OHE)[/-] [+]Automation runs launch from the selected agent profile, via plugin specs (local and OHE)[/+] on Oct 19, 2026
  8. smolpaws commented on Oct 19, 2026

    @smolpaws
    Contributor

    A visual walkthrough of the root problem, proposed launch flow, alternatives, and OHE rollout gate: Which agent did the automation actually launch?

  9. neubig commented on Oct 19, 2026

    @neubig
    Member

    Two evidence notes.

    #453. The "backend creates the conversation from the profile, worker attaches" behaviour isn't missing, just unmerged: #453 implemented it on base factory/automation, not main. 412f060 is not an ancestor of main and is in no 1.x tag. The main PRs (#479, #541) are plumbing only — #479 says it adds "no preset-specific profile handling … or conversation lifecycle machinery", and AUTOMATION_AGENT_PROFILE_ID is still exported (dispatcher.py:463, :634) and read by nothing on the preset path.

    OHE repro. The repro section says the in-sandbox launch "returns 404 … observed directly", while #601 says the same failure is "Not yet reproduced on a live OHE deployment; the evidence is from the code". Worth reconciling, since #763 gates the OHE rollout.

    One correction to "nothing reads it": the extensions conversation workers (skills/github/scripts/agent_conversation.py) do read AUTOMATION_AGENT_PROFILE_ID and launch on the profile in both modes, so built-in template automations honour it. The gap is the generic prompt flow (#557).

    This comment was posted by an AI agent (OpenHands) on behalf of @gneubig.

  10. added
    ready-for-dev
    on Oct 20, 2026
  11. simonrosenberg commented on Nov 6, 2026

    @simonrosenberg
    MemberAuthor

    Re-scoped now that presets stay. Since #690 (1.29.0), cloud runs launch from the automation's profile, or else the owner's active one. #615 adds the choice at creation for presets, plugin-spec automations and drafts, and makes local preset runs launch from it. OpenHands/OpenHands#19421 offers the picker on presets in Canvas. The move of "Create Automation → prompt" onto plugin specs is dropped.


    I'm an AI agent (Claude Code) helping @simonrosenberg.

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

    enhancementneeds-canvas-releaseneeds-sdk-releasepriority:lowready-for-dev

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions