feat: add editable automation descriptions - #389
Open
santhiprakash wants to merge 1 commit into
Open
Conversation
santhiprakash
force-pushed
the
feat/automation-description
branch
2 times, most recently
from
August 27, 2026 13:16
faaba7e to
53b6465
Compare
- 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
force-pushed
the
feat/automation-description
branch
from
August 27, 2026 14:39
53b6465 to
4288a54
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
022_add_automation_description— nullableTextcolumndescriptiononautomations(cross-DB: genericsa.Text, upgrade + downgrade verified on SQLite). Renumbered to022aftermainmerged021_add_run_current_phase(feat: report live run phases for dashboard visibility #388), so the chain stays single-head.models.py—Automation.description: Mapped[str | None].schemas.py—description: str | None(max_length=2000) onCreateAutomationRequestandUpdateAutomationRequest; exposed onAutomationResponse. The PATCH handler needs no change (it already setattrs everything inbody.model_dump(exclude_unset=True), so an explicitnullclears the field).router.py—create_automationpassesbody.descriptionthrough.preset_router.py— same field onCreatePromptAutomationRequest/CreatePluginAutomationRequest, and bothAutomation(...)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 withextra="forbid"would 422 a PATCH carryingdescription).git_sync/serializer.py—descriptionserialized intoautomation.yamlonly when non-null, matching the existingtarball_executablesreasoning: emittingdescription: nullfor 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_fieldsreadsdescriptionback, so a git-side edit imports on the next sync cycle (both create and update paths).Parts 2 (
OpenHands/extensionsmanifest attribute) and 3 (OpenHands/OpenHandsUI) are separate PRs per the issue's sequencing; this PR is self-contained and backwards-compatible.Verification
uv run pytest tests/ -q --ignore=tests/integration→ 1462 passed, 0 failed (includes new tests below).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's021_add_run_current_phase): full suite → 1486 passed, 0 failed on SDK 1.44.0;alembichistory verified single-head… → 020 → 021 → 022withcurrent_phaseonautomation_runsanddescriptiononautomations, plusdowngrade -1→021and re-upgrade head→022on a scratch SQLite DB; pre-commit (ruff format/lint, pycodestyle, pyright) all pass.alembic upgrade headthenalembic downgrade -1against 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.py—descriptionkey omitted fromautomation.yamlwhen null; serialized when set; round-trips throughdeserialize_automation.tests/test_git_sync.py— full sync-cycle round trip: description lands inautomation.yaml, and a git-side edit to it imports back into the DB on the next cycle.tests/test_capabilities_router.py—automationDescriptionadvertised.Notes
AutomationResponseconstructor fixture intests/test_schemas.py(addeddescription=Noneto the defaults dict) — additive, no assertions changed.HUMAN: no human review was performed on this change; authored by Santhi Prakash with AI assistance and verified as described above.