Skip to content

feat: allow raw automations to start disabled - #387

Open
XiaoFeiCode wants to merge 1 commit into
OpenHands:mainfrom
XiaoFeiCode:feat/create-disabled-automation-drafts-16567
Open

feat: allow raw automations to start disabled#387
XiaoFeiCode wants to merge 1 commit into
OpenHands:mainfrom
XiaoFeiCode:feat/create-disabled-automation-drafts-16567

Conversation

@XiaoFeiCode

Copy link
Copy Markdown

Why

OpenHands/OpenHands#16567 adds a controlled test-run gate to automation creation. Raw bundle automations must be persisted as disabled before their first manual dispatch; creating them enabled and disabling them in a follow-up request leaves a race where a schedule or event can trigger untested code.

Summary

  • add an optional enabled field to CreateAutomationRequest, defaulting to true for backward compatibility
  • pass the requested state into the persisted Automation
  • cover explicit disabled creation while preserving the existing default-enabled behavior

Related issue

Supports OpenHands/OpenHands#16567.

Validation

  • uvx ruff check openhands/automation/router.py openhands/automation/schemas.py tests/test_router.py
  • uvx ruff format --check openhands/automation/router.py openhands/automation/schemas.py tests/test_router.py
  • python -m py_compile openhands/automation/router.py openhands/automation/schemas.py tests/test_router.py
  • git diff --check

The targeted pytest could not be executed on Windows because litellm==1.93.0 publishes Linux wheels only and its source build requires an MSVC linker that is not installed. The test is included for Linux CI.

@all-hands-bot

Copy link
Copy Markdown
Contributor

👋 This PR needs a couple of things fixed before OpenHands can review it:

  • the PR description's HUMAN: section needs at least 20 characters describing what you tested, not just the template placeholder

Push an update once this is addressed and this check re-runs automatically.

This is an automated check - no AI was used to generate this comment.

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

Labels

type: feat A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants