Repository navigation
Description
Part of #600.
Problem or Use Case
The plugin_spec conversation runner (#580, automation 1.21.0+) launches its conversation from the automation's agent profile: RemoteConversation.create(workspace, StartConversationRequest(agent_profile_id=…)) (openhands/automation/presets/plugin_spec/sdk_main.py). In cloud mode the workspace is OpenHandsCloudWorkspace(local_agent_server_mode=True), so the request goes to the sandbox's own agent-server.
That agent-server resolves agent_profile_id only from its local profile store (SDK openhands-agent-server/openhands/agent_server/launch.py). An unknown id raises ProfileNotFound, which returns 404. On OHE that store has no agent profiles:
- Profiles live in enterprise (
org.agent_profiles). - Enterprise copies only LLM profiles into sandboxes, and only when it starts a conversation itself.
The dispatcher's preflight checks the profile against the app server's /api/agent-profiles, so it passes, and the launch inside the sandbox is then expected to fail with 404. Not yet reproduced on a live OHE deployment; the evidence is from the code.
Secret scoping has the same gap. workspace.get_secrets(agent_profile_id=…) passes a parameter that enterprise's sandbox secrets endpoint ignores.
Desired Behavior
For plugin-spec conversation runs, the automation service creates the conversation at dispatch and the runner attaches to it.
- Creation. After the sandbox is ready, the dispatcher calls a new backend method,
create_conversation:LocalAgentServerBackend: agent-serverPOST /api/conversationswithagent_profile_id,pluginsand the run's tags.CloudSandboxBackend: enterprisePOST /api/v1/app-conversationswith the run'ssandbox_id,agent_profile_id,plugins,tagsandtrigger: automation, using the minted user key. It then polls the start task for the conversation id.
- Follow-ups. Runs that continue a conversation (
continue_conversation) reuse the subject's conversation. - Provenance check. If the conversation's
launched_agent_profileisn't the requested profile, the run fails before the runner starts. - Runner. The dispatcher exports
AUTOMATION_CONVERSATION_ID. The runner attaches withRemoteConversation.attach(...), then sends the prompt, runs and reports as today. It no longer creates conversations, and no longer passesagent_profile_idtoget_secretson OHE.
Acceptance Criteria
- Reproduce the current OHE behavior, or reproduce it locally with an agent-server that lacks the profile, and record the error.
- Locally and on OHE, a plugin-spec conversation run's conversation is created at dispatch through the run's backend, and its
launched_agent_profileequals the run's profile. - A missing, inaccessible or silently replaced profile fails the run with a visible error before the runner starts.
- Runs that continue a conversation reuse the existing one.
- The runner attaches instead of creating, and the existing
plugin_spectests pass once updated for attach.
Additional Context
- Design: Automation runs launch from the selected agent profile, via plugin specs (local and OHE) #600, design point 1.
- OHE limitation: profile tools and
secret_refsare only honored once fix(agent-profiles): align Enterprise launches with the SDK enterprise#763 lands, so plugin-spec allowlists aren't enforced on OHE until then. - Related: Proposal: plugin-backed executable automations with validated profiles #579, Discussion: one-click launch share experience for plugin-based automations (demo options) #609.
OpenHands AI triage
The following comments and acceptance criteria were added by the OpenHands AI agent.
Triage
Verified on main 9636764 (= 1.21.0). In cloud mode the plugin_spec runner builds OpenHandsCloudWorkspace(local_agent_server_mode=True) (openhands/automation/presets/plugin_spec/sdk_main.py:158) and then calls RemoteConversation.create(workspace, StartConversationRequest(agent_profile_id=...)) (:247), so the launch goes to the sandbox's own agent-server. The pinned SDK 1.55.1 resolves agent_profile_id only from that server's local profile store (openhands-agent-server/openhands/agent_server/launch.py, get_agent_profile_store()); an enterprise profile id is absent there, so an unknown id raises ProfileNotFound (404). The dispatcher preflight (_validate_plugin_run_agent_profile -> GET /api/agent-profiles on the app server) passes, so the failure surfaces only inside the sandbox. Secret scoping has the same gap: workspace.get_secrets(agent_profile_id=...) (:211) passes a parameter that enterprise's GET /{sandbox_id}/settings/secrets ignores. The issue states this is not yet reproduced on a live OHE deployment; the evidence is from the code, so the first criterion records the reproduction.
Scope: on OHE/Cloud, the plugin_spec runner starts its conversation through enterprise's POST /api/v1/app-conversations (the run's sandbox_id, the agent_profile_id, plugins, tags, trigger: automation, and the task as the initial message) and then attaches to that conversation on the sandbox's agent-server; local mode is unchanged. An unknown or inaccessible profile fails the run visibly, with no fallback to the default agent.
Non-goals: the prompt/plugin preset driver's OHE path, the LLM-profile override, the finish policy / hook_config forwarding (OpenHands/enterprise#868), the capability flag, and preset create/update accepting agent_profile_id are tracked in #600 and #557, not here. No change to manifest fetch, tarball construction, dispatch env vars, run lifecycle, or the plugin-spec create contract.
Dependency: the "one shared launch helper" criterion completes when #600's preset driver lands in this repository; until then the runner's helper is the single launch path for plugin_spec runs.
Acceptance Criteria
- The current failure is reproduced and recorded: a cloud-mode
plugin_specrun whoseagent_profile_idis absent from the sandbox agent-server's profile store fails with theProfileNotFound/ 404 error, with the observed error text and the command or deployment that produced it. - On OHE/Cloud, a
plugin_specrun with a profile starts its conversation through enterprise'sPOST /api/v1/app-conversations, passing the run'ssandbox_id, theagent_profile_id, the plugin sources, the run's tags, andtrigger: automation; the run then attaches to that conversation on the sandbox's agent-server rather than creating one there. - The launched conversation reports
launched_agent_profileequal to the run'sagent_profile_id, and carries the run's automation tags (e.g.automationname,automationrunid). - The profile's secret scoping applies on OHE: the secrets exposed to the conversation are limited by the profile's
secret_refs, and no request passesagent_profile_idto an endpoint that ignores it. - An unknown or inaccessible profile fails the run with a visible error (non-success run status and/or an error surfaced to the caller), and no default agent is launched.
- Local mode is unchanged: a local
plugin_specrun still launches viaRemoteConversation.create(StartConversationRequest(agent_profile_id=...))againstAGENT_SERVER_URL, and the existingplugin_spectests still pass. - The enterprise start-and-attach launch is implemented once and reused by both the
plugin_specrunner and, once Automation runs launch from the selected agent profile, via plugin specs (local and OHE) #600 lands, the preset driver; the runner holds no second copy of the OHE launch sequence. - Existing
plugin_specbehavior is preserved: tarball contents, entrypoint, and dispatch env vars (includingAUTOMATION_AGENT_PROFILE_ID) are unchanged, anduv run pytest tests/test_plugin_specs.pypasses.
Activity
simonrosenberg commentedon Oct 19, 2026
I'm an AI agent (Claude Code) helping @simonrosenberg. I updated the description to match the third version of #600. The automation service now creates every run's conversation through its per-mode backend (
POST /v1/runs/{run_id}/conversation), and the runner attaches to it. Two criteria in the AI triage above therefore change:POST /api/v1/app-conversations… then attaches." The service makes that call, not the runner. The runner only calls the automation endpoint and attaches.secret_refs." This can't be met from automation alone. Enterprise doesn't applysecret_refsyet, and that arrives with fix(agent-profiles): align Enterprise launches with the SDK enterprise#763.[-][Feature]: Route plugin_spec runs through enterprise's conversation start on OHE[/-][+][Feature]: Create plugin-spec conversations from the agent profile at dispatch (local and OHE)[/+]simonrosenberg commentedon Oct 19, 2026
I'm an AI agent (Claude Code) helping @simonrosenberg. This issue is now the core implementation piece of the re-scoped #600, which focuses on plugin-spec automations since the presets may be deprecated.
The service creates the conversation at dispatch on both backends, then the runner attaches. Plugin-spec runners prepare nothing before creating a conversation, so the service can create it up front.
The AI triage block below predates this re-scope:
secret_refscriterion depends on fix(agent-profiles): align Enterprise launches with the SDK enterprise#763.simonrosenberg commentedon Oct 19, 2026
I'm an AI agent (Claude Code) helping @simonrosenberg.
Confirmed on Beta (2026-10-19), which runs automation 1.21.0 and agent-server 1.55.1, the same versions as OHE 0.82.0/0.83.0.
I made the same call as the plugin-spec runner's launch, from the sandbox of a real automation run. It was
POST /api/conversationswithagent_profile_idset to an enterprise profile that enterprise resolves fine for interactive conversations. The response:The sandbox's agent-server lists only its own
defaultprofile, so a plugin-spec conversation run on OHE fails at creation today. This call created nothing. The test profile, automation and sandboxes were removed afterwards.feat: start plugin-spec conversations from the agent profile at dispatch
feat: start plugin-spec conversations from the agent profile at dispatch