Skip to content

Add automation-creation plugin#120

Open
malhotra5 wants to merge 6 commits intomainfrom
add-automation-plugin
Open

Add automation-creation plugin#120
malhotra5 wants to merge 6 commits intomainfrom
add-automation-plugin

Conversation

@malhotra5
Copy link
Contributor

@malhotra5 malhotra5 commented Mar 25, 2026

Add a new plugin that helps users create OpenHands automations through a guided slash command interface.

Features

  • /automation:create slash command for interactive automation setup
  • Guides users through tarball upload, cron schedule, and entrypoint configuration
  • References the skills/automation/SKILL.md for full API documentation

Plugin vs Skill Architecture

This PR adds:

  1. Plugin (plugins/automation-creation/): Provides the /automation:create slash command for interactive setup
  2. Skill (skills/automation/): Comprehensive API documentation triggered by automation-related keywords

Both cross-reference each other to maintain a single source of truth for API documentation.

Design Principles

  • Deduplication: API documentation lives only in skills/automation/SKILL.md
  • Plugin simplicity: README is 39 lines, command spec is 70 lines
  • Production URL: Uses hardcoded https://app.all-hands.dev/api/automation/v1

Plugin Structure (follows Claude Code marketplace format)

automation-creation/
├── .claude-plugin/
│   └── plugin.json      # Plugin manifest
├── commands/
│   └── create.md        # Slash command definition
└── README.md            # Brief overview with links to skill

Related to ALL-5567

Add a new plugin that helps users create OpenHands automations through
a guided slash command interface.

Features:
- /automation:create slash command for interactive automation setup
- Collects name, cron schedule, tarball path, entrypoint, and timeout
- Validates inputs before API call
- Provides helpful cron schedule examples
- Supports timeout configuration (1-600 seconds)

Plugin structure follows Claude Code marketplace format:
- .claude-plugin/plugin.json: Plugin manifest
- commands/create.md: Slash command definition
- README.md: Documentation with API reference

Co-authored-by: openhands <openhands@all-hands.dev>
@malhotra5 malhotra5 marked this pull request as draft March 25, 2026 14:45
Add skills/automation/:
- SKILL.md with full API reference for uploads and automations
- README.md with quick start guide
- Triggers: automation, scheduled task, cron job, cron schedule

Update plugins/automation-creation/:
- Add tarball upload step before automation creation
- Document upload constraints (1MB max, allowed content types)
- Update create.md command with upload workflow
- Add allowed-tools for tar, jq operations

Co-authored-by: openhands <openhands@all-hands.dev>
Copy link
Contributor

neubig commented Mar 26, 2026

🔍 CI Failure Analysis

Root Cause

The PR Review by OpenHands workflow is failing because the GITHUB_TOKEN environment variable is empty.

Looking at the error logs:

GITHUB_TOKEN: 
Error: github-token is required.
Process completed with exit code 1.

Why This Happens

The workflow file .github/workflows/pr-review-by-openhands.yml is configured to use:

github-token: ${{ secrets.ALLHANDS_BOT_GITHUB_PAT }}

However, the repository secret ALLHANDS_BOT_GITHUB_PAT is either:

  • Not configured in the repository settings
  • Empty/expired
  • Not accessible to this workflow

Recommended Fix

Use the built-in GitHub token instead, which is automatically available and has the necessary permissions:

github-token: ${{ secrets.GITHUB_TOKEN }}

This is consistent with how other workflows in this repo handle authentication (see .github/workflows/pr-review-evaluation.yml).

Permissions Verification

The workflow already declares appropriate permissions:

permissions:
    contents: read
    pull-requests: write
    issues: write

These permissions are sufficient for the PR review action when using pull_request_target trigger with secrets.GITHUB_TOKEN.

Action Required

A maintainer with repository admin access needs to either:

  1. Configure the ALLHANDS_BOT_GITHUB_PAT secret in repository settings (Settings → Secrets and variables → Actions), OR
  2. Update the workflow to use secrets.GITHUB_TOKEN instead (recommended)

Run ID: 23547081333
Failed Job: pr-review
Commit: c3f622e

@malhotra5
Copy link
Contributor Author

@OpenHands do the following

  1. clone the repo https://github.com/OpenHands/automation using the github token

  2. inspect the diff on this PR against main, which is adding a skill and plugin for the automation service

  3. update the skill and plugin based on the latest implementation inside the automation repo. note that the endpoints for the api are api/automation/v1/endpoint_name where api/automation is a prefix defined in the infra middleware, and automation repo adds a v1 prefix to every router

  4. give me a summary of how I can QA the skill/plugin myself

  5. after you've pushed your changes, wait for the CI results and make sure its not failing

@openhands-ai
Copy link

openhands-ai bot commented Mar 26, 2026

I'm on it! malhotra5 can track my progress at all-hands.dev

- Change API base URL from automations.all-hands.dev/api/v1 to
  app.all-hands.dev/api/automation/v1 per infra middleware routing
- Fix response field name from 'triggers' to 'trigger' in examples
- Add List Automation Runs endpoint documentation
- Update environment variables section with correct vars:
  - Add SANDBOX_ID and SESSION_API_KEY
  - Remove AUTOMATION_CALLBACK_URL and AUTOMATION_RUN_ID (internal)
- Add user_id, org_id, and last_triggered_at to response examples
- Note that completion callbacks are handled automatically by framework

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
@openhands-ai
Copy link

openhands-ai bot commented Mar 26, 2026

Final Summary

✅ Request Checklist

Task Status
1. Clone the OpenHands/automation repo ✅ Done
2. Inspect the PR diff against main ✅ Done
3. Update skill/plugin based on automation repo ✅ Done
4. Provide QA summary ✅ Done
5. Push changes and wait for CI to pass ✅ Done (22/22 tests passing)

Changes Made

Files Updated:

  • skills/automation/SKILL.md - Updated API URLs, response examples, environment variables
  • skills/automation/README.md - Updated API URLs and endpoints table
  • plugins/automation-creation/commands/create.md - Updated API URLs
  • plugins/automation-creation/README.md - Updated API URLs and response examples
  • marketplaces/default.json - Added automation skill entry (required for CI to pass)

Key Changes:

  • API Base URL: automations.all-hands.dev/api/v1/automationsapp.all-hands.dev/api/automation/v1 (per infra middleware routing)
  • Response field: triggerstrigger
  • New endpoint documented: GET /{automation_id}/runs for listing automation runs
  • Environment variables: Added SANDBOX_ID, SESSION_API_KEY; removed internal-only vars

Conciseness Check

✅ All changes are directly related to updating the skill/plugin based on the automation repo implementation. No extraneous changes were made.

CI Status

✅ All checks passed:

  • Tests: 22/22 passing
  • Claude Code Compatibility: Validated

PR #120 is updated and ready for review: #120

- Document that automations must use the OpenHands Software Agent SDK
- Add link to SDK docs: https://docs.openhands.dev/sdk
- Add setup.sh example that installs SDK packages
- Include complete Python example using OpenHandsCloudWorkspace
- Reference test_tarball example from automation repo
- Make setup.sh REQUIRED (installs SDK dependencies)

Co-authored-by: openhands <openhands@all-hands.dev>
@malhotra5 malhotra5 marked this pull request as ready for review March 26, 2026 21:54
Copy link
Contributor

@all-hands-bot all-hands-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Needs improvement - Fundamental design issues must be addressed.

KEY INSIGHT: This PR suffers from massive content duplication across plugin README, command spec, and skill definition - a data structure problem that creates a maintenance nightmare and suggests unclear architectural boundaries.

@malhotra5
Copy link
Contributor Author

@OpenHands please update this implementation based on the review comments

Also we may require plugins for other ecosystems outside of openhands. So examine other plugin implementations in this repo and see what best practices are. Can we dedup the contents here?

Also always use the production api url, its fine if that's hardcoded

@openhands-ai
Copy link

openhands-ai bot commented Mar 26, 2026

I'm on it! malhotra5 can track my progress at all-hands.dev

Address review comments:
- Reduce README from 303 lines to 39 lines by removing API duplication
- Reduce create.md from 198 lines to 70 lines, focusing on workflow only
- Add cross-references between plugin and skill
- Add automation-creation plugin to marketplace
- Keep production API URL hardcoded (https://app.all-hands.dev/api/automation/v1)

Plugin now provides only the /automation:create slash command.
Full API documentation remains in skills/automation/SKILL.md.

Co-authored-by: openhands <openhands@all-hands.dev>
@openhands-ai
Copy link

openhands-ai bot commented Mar 26, 2026

Final Summary

I've addressed the review comments on PR #120 and the user's additional requests. Here's the checklist:

✅ Request Checklist

Request Status
Update implementation based on review comments ✅ Done
Examine other plugin implementations for best practices ✅ Done (reviewed city-weather, pr-review)
Deduplicate contents ✅ Done (removed 436 lines of duplication)
Use production API URL (hardcoded is fine) ✅ Done (https://app.all-hands.dev/api/automation/v1)

Changes Made

Files Modified:

  • plugins/automation-creation/README.md — Reduced from 303 → 39 lines
  • plugins/automation-creation/commands/create.md — Reduced from 198 → 70 lines
  • skills/automation/SKILL.md — Added cross-reference to plugin
  • marketplaces/default.json — Added automation-creation plugin entry

Architecture Clarification:

  • Plugin: Provides /automation:create slash command for interactive setup
  • Skill: Contains all API documentation (single source of truth)
  • Both now cross-reference each other

Conciseness Check

All changes are directly related to the user's requests:

  • ✅ No extraneous changes
  • ✅ Only removed duplicate content
  • ✅ Added minimal cross-references for clarity

PR Status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants