Repository navigation
Description
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 byagent_profile_id, which works locally, but:- 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).
- The manifest's
runtime.agent_profile.default_namefixes the profile; the user can't choose it when creating the automation. - A typed prompt can't be expressed, because the runner's prompt is
/{plugin}:{command} {arguments}from the manifest. - 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).
- On OHE, enterprise doesn't honor a profile's
toolsorsecret_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_idtoPOST /v1/preset/promptreturns 422extra_forbidden. - Inside the run's sandbox, the plugin-spec runner's launch (
POST /api/conversationswith the enterprise profile id) returns 404Agent profile with id '…' not found. That agent-server's profile store holds only its owndefaultprofile. 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.
- 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/conversationswithagent_profile_id,pluginsand the run's tags. - OHE/Cloud: enterprise
POST /api/v1/app-conversationswith the run'ssandbox_id,agent_profile_id,plugins,tagsandtrigger: automation. These are all fields it already accepts. - Check: if the conversation's
launched_agent_profileisn't the requested profile, the run fails. - Runner: it attaches, sends the prompt with its event context, waits and reports as today.
- Local: agent-server
- Users choose the profile.
POST /v1/plugin-specaccepts an optionalagent_profile_id, checked against the manifest's allowlists. Without it, the manifest'sdefault_nameapplies, as today. - Prompts become plugin specs. A stock conversation plugin runs a prompt supplied per automation, for example
entrypoint.argumentsrendered fromconfig. "Create Automation → enter a prompt" then creates a plugin-spec automation on the chosen profile, defaulting to the user's active one. - 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:
- fix(agent-profiles): align Enterprise launches with the SDK enterprise#763: honor profile tools and
secret_refs, so the allowlists hold on OHE. Sub-agents don't need it: enterprise already offerstaskwhen the profile's tools includetask_tool_set(the Beta control above). - [Feature]: Show the agent profile tools editor on cloud once enterprise honors profile tools OpenHands#18656: show the tools editor on cloud.
- Every user needs a usable profile: profile seeding (Discussion: one-click launch share experience for plugin-based automations (demo options) #609), and [Agent Profile] One launch path: no inline launches, always an active profile, one resolver software-agent-sdk#5982 locally.
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/conversationson the configured agent-server.CloudSandboxBackend:POST /api/v1/app-conversationswith the run'ssandbox_idand 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(...)withRemoteConversation.attach(workspace, AUTOMATION_CONVERSATION_ID). It keeps the event-context prompt,send_message,runand/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:
- (a) render
entrypoint.argumentsfromconfig(for example{{config.prompt}}), reusing the existing config templating, with the stock plugin in OpenHands/extensions; chosen (feat: let users choose an automation's agent profile #615, feat(plugins): add prompt-task, the stock plugin for prompt automations extensions#799); - (b) ship a built-in stock plugin with the automation service.
4. Presets frozen.
- Preset scripts and endpoints don't change, and the endpoints keep rejecting
agent_profile_id. - Until the presets are deprecated, Canvas hides the profile pill on preset forms ([Bug]: New Automation panel still 422s on Agent profile for Prompt/Plugin automations (#17971 only fixed the catalog Setup Dialog) OpenHands#18569).
- Prompt and plugin presets ignore the selected agent profile at run time #557 closes when the prompt flow creates plugin specs.
5. Parked.
- Finish requirement: the finish hook and structured
TaskOutcome(Apply preset FinishTool hooks to profile-created conversations #457, the finish-schema ask on [OSS→OHE parity] Shared launch additions and per-launch LLM override precedence software-agent-sdk#6080, the hook and schema parts of Accept hook_config, a finish response schema and an LLM profile reference on app-conversation start enterprise#868). The plugin-spec runner removed its finish hook. - LLM override: the LLM-profile reference on enterprise's start (Accept hook_config, a finish response schema and an LLM profile reference on app-conversation start enterprise#868), since the agent profile owns the model.
- Revisit either if plugin specs need structured outcomes or model overrides.
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.
- For: fixes today's UI flow without waiting for plugin specs to reach users.
- Against: invests in a path that may be deprecated. It also needs finish-policy contract changes (Accept hook_config, a finish response schema and an LLM profile reference on app-conversation start enterprise#868 and an SDK field) that plugin specs don't need.
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
taskwhen 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)
- Plugin-spec conversation runs are the path for profile-based automations. The presets are frozen, not fixed.
- The service creates the run's conversation at dispatch through its per-mode backend, and the runner attaches.
- A provenance check fails the run when the launched profile differs from the requested one.
POST /v1/plugin-specaccepts an optional user-chosenagent_profile_idwithin the manifest's allowlists.- A typed prompt becomes a plugin-spec automation through a stock conversation plugin.
- 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:
- 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-specwithprompt-task. - fix(agent-profiles): align Enterprise launches with the SDK enterprise#763 afterwards, for the allowlists.
- The same release covers local, where the only change is profile choice.
Acceptance Criteria
- Local run: a plugin-spec conversation run reports
launched_agent_profileequal to its profile. The model is offered that profile's tools, includingtaskwhen 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
taskwhen 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-specaccepts an optionalagent_profile_idwithin 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_idto 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_modelcan'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:
- fix(agent-profiles): align Enterprise launches with the SDK enterprise#763 is needed only for the allowlists, not for sub-agents.
- Rollout is OHE first.
- Option (a) chosen for prompts.
- Implementation PRs linked; the cloud path is not yet run on Beta.
Activity
all-hands-bot commentedon Oct 19, 2026
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 confirmsection, so scope and acceptance criteria cannot be finalized yet. Please answer:resolve_model_profile_for_useralready 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."simonrosenberg commentedon Oct 19, 2026
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.
resolve_model_profile_for_userfor 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.sandbox_idis only a fallback if a fix has to ship first.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).simonrosenberg commentedon Oct 19, 2026
I'm an AI agent (Claude Code) helping @simonrosenberg. I re-checked every contract on the latest code (SDK
main3f3294581e, enterprisemain95693e3264, Canvasmain79abd32d85, automation 1.21.0) and rewrote the issue body. The main changes:taskwhenenable_sub_agentsis set.secret_refsis ignored.agent_profile_idlaunch locally, enterprise's conversation start with the run'ssandbox_idon OHE. This replaces the service driving runs over the API, and the run lifecycle stays as it is.enable_sub_agentsin OHE agent settings, rather than with today's default agent.hook_config(already a request field locally; enterprise must forward it) plus a narrow typed finish-schema launch option, with a client-tool fallback.plugin_specrunner (feat: add plugin-backed executable automations #580) launches by profile on the sandbox's own agent-server, which can't resolve enterprise profiles.simonrosenberg commentedon Oct 19, 2026
I'm an AI agent (Claude Code) helping @simonrosenberg. I updated the issue body to the third version of the design:
LocalAgentServerBackend,CloudSandboxBackend) via a newPOST /v1/runs/{run_id}/conversation. The run's script clones repositories, requests the conversation, attaches and reports as today. Scripts no longer branch by mode or call enterprise, and [Feature]: Create plugin-spec conversations from the agent profile at dispatch (local and OHE) #601 folds into this.launched_agent_profiledoesn't match, the run fails. Automation correctness no longer waits on [Agent Profile] Fail closed when a scoped launch profile cannot be resolved enterprise#759.llm_modelonly swaps the model name, so it can't carry an LLM profile. Accept hook_config, a finish response schema and an LLM profile reference on app-conversation start enterprise#868 now also asks for an LLM-profile reference, and until then "agent profile XOR model" stays on OHE.FinishToolresponse_schemaparameter (#868). The new SDK field is only needed for agent-server profile launches.[-]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)[/+]smolpaws commentedon Oct 19, 2026
A visual walkthrough of the root problem, proposed launch flow, alternatives, and OHE rollout gate: Which agent did the automation actually launch?
neubig commentedon Oct 19, 2026
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, notmain.412f060is not an ancestor ofmainand is in no 1.x tag. ThemainPRs (#479, #541) are plumbing only — #479 says it adds "no preset-specific profile handling … or conversation lifecycle machinery", andAUTOMATION_AGENT_PROFILE_IDis 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 readAUTOMATION_AGENT_PROFILE_IDand 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.
feat: let users choose a plugin-spec automation's agent profile
feat: let users choose a plugin-spec automation's agent profile
feat: let users choose a plugin-spec automation's agent profile
feat: let users choose a plugin-spec automation's agent profile
feat: let users choose a plugin-spec automation's agent profile
feat: let users choose a plugin-spec automation's agent profile
feat: let users choose a plugin-spec automation's agent profile
simonrosenberg commentedon Nov 6, 2026
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.
feat: let users choose an automation's agent profile (#615)