Skip to content

feat: add editable automation descriptions - #389

Open
santhiprakash wants to merge 1 commit into
OpenHands:mainfrom
santhiprakash:feat/automation-description
Open

feat: add editable automation descriptions#389
santhiprakash wants to merge 1 commit into
OpenHands:mainfrom
santhiprakash:feat/automation-description

Conversation

@santhiprakash

@santhiprakash santhiprakash commented Aug 26, 2026

Copy link
Copy Markdown

Problem

An automation carries only a name — there is no field anywhere that describes what it does, so list/detail surfaces fall back to rendering the raw prompt as the subtitle and cards read as instructions addressed to an agent rather than a summary addressed to a person.

Implements part 1 (this repo) of OpenHands/OpenHands#16925: persist and expose an editable description.

Changes

  • Migration 022_add_automation_description — nullable Text column description on automations (cross-DB: generic sa.Text, upgrade + downgrade verified on SQLite). Renumbered to 022 after main merged 021_add_run_current_phase (feat: report live run phases for dashboard visibility #388), so the chain stays single-head.
  • models.pyAutomation.description: Mapped[str | None].
  • schemas.pydescription: str | None (max_length=2000) on CreateAutomationRequest and UpdateAutomationRequest; exposed on AutomationResponse. The PATCH handler needs no change (it already setattrs everything in body.model_dump(exclude_unset=True), so an explicit null clears the field).
  • router.pycreate_automation passes body.description through.
  • preset_router.py — same field on CreatePromptAutomationRequest / CreatePluginAutomationRequest, and both Automation(...) constructions, so template/preset-created automations can carry one.
  • capabilities_router.py"automationDescription" added to _STATIC_FEATURES, so the UI can gate the field on service version (an older service with extra="forbid" would 422 a PATCH carrying description).
  • git_sync/serializer.pydescription serialized into automation.yaml only when non-null, matching the existing tarball_executables reasoning: emitting description: null for automations that have none would rewrite every synced file (and its content hash) on the first cycle, pushing one no-op commit per already-synced automation.
  • git_sync/loop.py_validate_and_resolve_fields reads description back, so a git-side edit imports on the next sync cycle (both create and update paths).

Parts 2 (OpenHands/extensions manifest attribute) and 3 (OpenHands/OpenHands UI) are separate PRs per the issue's sequencing; this PR is self-contained and backwards-compatible.

Verification

  • uv run pytest tests/ -q --ignore=tests/integration1462 passed, 0 failed (includes new tests below).
  • Rebased onto main @ f1b3244 (release 1.9.0; includes chore: bump SDK to 1.44.0 #393 SDK 1.44.0 bump and feat: report live run phases for dashboard visibility #388's 021_add_run_current_phase): full suite → 1486 passed, 0 failed on SDK 1.44.0; alembic history verified single-head … → 020 → 021 → 022 with current_phase on automation_runs and description on automations, plus downgrade -1021 and re-upgrade head022 on a scratch SQLite DB; pre-commit (ruff format/lint, pycodestyle, pyright) all pass.
  • alembic upgrade head then alembic downgrade -1 against a scratch SQLite DB — column added/removed cleanly.
  • uv run pre-commit run --files <all changed files> — ruff format, ruff lint, pycodestyle, pyright all pass.

New regression tests:

  • tests/test_router.py — create with/without description (persisted + echoed, absent → null); 2001-char description rejected (422); PATCH sets and explicitly-null clears.
  • tests/test_git_sync_serializer.pydescription key omitted from automation.yaml when null; serialized when set; round-trips through deserialize_automation.
  • tests/test_git_sync.py — full sync-cycle round trip: description lands in automation.yaml, and a git-side edit to it imports back into the DB on the next cycle.
  • tests/test_capabilities_router.pyautomationDescription advertised.

Notes

HUMAN: no human review was performed on this change; authored by Santhi Prakash with AI assistance and verified as described above.

@github-actions github-actions Bot added the type: feat A new feature label Aug 26, 2026
@santhiprakash
santhiprakash force-pushed the feat/automation-description branch 2 times, most recently from faaba7e to 53b6465 Compare August 27, 2026 13:16
- Problem: an automation carries only a name; list/detail surfaces fall back
  to rendering the raw prompt as the subtitle, so cards read as instructions
  addressed to an agent rather than a summary addressed to a person
  (OpenHands/OpenHands#16925, part 1 of 3).
- Fix: nullable `description` Text column on `automations` (migration 020),
  exposed on Create/Update request schemas (max 2000 chars) and
  AutomationResponse, passed through create_automation and both preset
  creation endpoints, advertised as the `automationDescription` static
  capability, and round-tripped through git sync (serialized into
  automation.yaml only when non-null so upgrading rewrites no synced files,
  read back on import).
- Verification: uv run pytest tests/ -q --ignore=tests/integration → 1462
  passed; alembic upgrade head + downgrade -1 on a scratch SQLite DB;
  pre-commit (ruff format/lint, pycodestyle, pyright) clean on all changed
  files.
@santhiprakash
santhiprakash force-pushed the feat/automation-description branch from 53b6465 to 4288a54 Compare August 27, 2026 14:39
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.

[Feature]: Give automations an editable description, shown in the UI

1 participant