Skip to content

fix(hello-world-automation): use script runner so plugin-spec curl works without a pre-provisioned agent profile - #798

Closed
juanmichelini wants to merge 1 commit into
openhands/automation-plugin-hello-worldfrom
openhands/automation-plugin-hello-world-script-runner
Closed

juanmichelini wants to merge 1 commit into
openhands/automation-plugin-hello-worldfrom
openhands/automation-plugin-hello-world-script-runner

Conversation

@juanmichelini

Copy link
Copy Markdown
Collaborator

What

Follow-up to #767. Switches the hello-world-automation plugin from the conversation runner to the script runner so that POST /api/automation/v1/plugin-spec succeeds on a fresh org without a pre-provisioned agent profile.

Why

The manifest on this branch declares a required runtime.agent_profile with default_name: "hello-world-agent" and allowed_tools: ["terminal"]. The automation service resolves that profile against the caller's org at plugin-spec creation time (_resolve_plugin_spec_runtime_fields -> validate_agent_profile_allowlists), so creating the automation fails with:

422 Agent profile `hello-world-agent` not found

on any org that hasn't pre-provisioned a profile with that exact name and tool set. That makes the example impossible to try out of the box.

The script runner needs no agent/LLM profile at all — it packages a deterministic entrypoint with no conversation and no LLM. With runner: "script" and no runtime.agent_profile, the profile lookup is skipped (validate_agent_profile_allowlists_with_client returns early when both id and name are empty), so the curl returns 201 and a dispatched run produces output immediately.

Changes

  • .plugin/plugin.json: entrypoint.runner -> "script", entrypoint.command -> "python3 scripts/main.py"; removed runtime.agent_profile.
  • scripts/main.py (new): reads AUTOMATION_CONFIG_PATH for the greeting, echoes injected profile/env context, notes any AUTOMATION_EVENT_PAYLOAD, and fires the completion callback (COMPLETED/FAILED) via AUTOMATION_CALLBACK_URL.
  • README.md: rewritten to describe the script runner and explain why it's used instead of the conversation runner.
  • marketplaces/openhands-extensions.json + root README.md catalog: description synced.

Verification

Validated the manifest against the merged automation-service schema (AutomationPluginManifest.model_validate) and built the execution payload locally:

MANIFEST VALID; runner: script cmd: python3 scripts/main.py agent_profile: None
PATHS OK
PAYLOAD BUILT OK; tar bytes: 718
resolved runner: script
resolved entrypoint: cd "$AUTOMATION_PLUGIN_ROOT" && python3 scripts/main.py
resolved agent_profile_name: None
tarball members: ['.automation/config.json', '.automation/execution.json', '.automation/plugins.json']

Ran the entrypoint locally:

$ AUTOMATION_CONFIG_PATH=/dev/null python3 scripts/main.py
=== HELLO WORLD AUTOMATION ===
  message: Hello from the automation plugin
  agent_profile_name: (none)
  llm_profile_name: (none)
  event_context: (none)

Hello from the automation plugin 👋

Repo checks pass: python scripts/sync_extensions.py --check and python scripts/check_plugin_resources.py both exit 0.

Trade-off

This changes what the example demonstrates: it no longer shows the conversation/stock runner + agent_profile.allowed_tools allowlist. A conversation-runner example fundamentally can't be created on a fresh org without first provisioning the named profile, so it can't be the "try it with one curl" example. If a conversation-runner example is still wanted, it could live in a separate plugin that documents the profile provisioning as a prerequisite.

This PR was created by an AI agent (OpenHands) on behalf of @juanmichelini.

…rks without a pre-provisioned agent profile

The conversation-runner manifest declared a required runtime.agent_profile
with default_name "hello-world-agent" and allowed_tools ["terminal"]. The
automation service resolves that profile against the caller's org at
plugin-spec creation time, so POST /api/automation/v1/plugin-spec fails
with 422 "Agent profile 'hello-world-agent' not found" on any org that
hasn't pre-provisioned a profile with that exact name and tool set.

Switch the entrypoint to the script runner (runner: "script",
command: "python3 scripts/main.py") and drop the runtime.agent_profile
requirement. The script runner packages a deterministic entrypoint with
no conversation and no LLM, so no agent/LLM profile needs to exist for
the curl to succeed and a dispatched run to produce output.

Add scripts/main.py: reads AUTOMATION_CONFIG_PATH for the greeting,
echoes injected profile/env context, notes any event payload, and fires
the completion callback (COMPLETED/FAILED) via AUTOMATION_CALLBACK_URL.

Update README and marketplace/catalog description to match.

Co-authored-by: openhands <openhands@all-hands.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants