Skip to content

🙌 OpenHands: AI-Driven Development

22.8 KB
Raw Blame

F28 — Automation setup page

The setup page is the one form for making and changing automations outside the template dialog. Add Automation → Create Automation opens it blank at /automations/setup; a saved draft reopens at /automations/setup?draftId=<id>; kebab Edit opens an existing automation at /automations/setup?automationId=<id>. The form collects Name, a Prompt (or Custom Python with entrypoint and setup script), model (LLM profile) and repositories, a Schedule or Event trigger, and optional plugins and timeout. A docked composer under the form can ask the agent to fill it. Create mode's toolbar has Save draft, Test and Create Automation; edit mode's has Test, Save and Close. A server-backed draft carries the server's validation result and test runs; Create turns it into a real, enabled automation and removes the draft.

F22 keeps F22.agent-assisted-setup (the end-to-end agent, plugin, phone and draft-Test recipes); F23 owns edit mode (F23.edit-*, including Test and the save state on the edit page). This family gives each create-mode behavior its own ID so a pass can fail one without failing the others.

Source: src/routes/automation-setup-new.tsx, src/components/features/automations/setup/ (automation-setup-panel.tsx, automation-setup-prompt-stack.tsx, automation-setup-draft-service.ts), src/hooks/use-start-automation-setup.ts, src/hooks/use-open-automation-editor.ts.

Sub-features

  • F28.open-blank: Create Automation opens /automations/setup with Name pre-filled New Automation (placeholder Standup digest), an empty Prompt, Schedule selected with Daily at 09:00 in America/New_York (the default, whatever the browser's time zone), the docked composer (Need help creating an automation?) and no new conversation. The save state already reads Unsaved changes and the toolbar Test is disabled. Neither the Prompt nor the Custom kind offers an agent profile (automation-agent-profile count 0); the Prompt kind shows only the LLM profile pill automation-setup-model.
  • F28.kind-toggle: the button beside the Prompt label switches between Prompt and Custom (Custom Python). Custom shows a generated Python script that calls AUTOMATION_CALLBACK_URL, and Entrypoint and setup reveals Entrypoint python3 main.py, Setup script path setup.sh and a no-op setup script; switching back shows the Prompt again.
  • F28.schedule-presets: in create mode the Frequency control (the same control as on the edit page, whose presets and saving F23 owns as edit-schedule and edit-cron) starts on Daily at 09:00, and switching presets fills create-mode defaults: Once a date-time at the next whole hour today, Weekly Monday, and Custom the cron of the preset it replaces (from Weekly, Monday at 10:30 it reads 30 10 * * 1; Weekdays 30 10 * * 1-5, Hourly 0 * * * *, Once on 17 October at 09:00 0 9 17 10 *). Clicking Custom again keeps a cron already typed there; leaving Custom for a preset and coming back starts from that preset again. Every preset keeps the 13-entry time zone select.
  • F28.event-trigger: choosing Event replaces the schedule with Event source (default GitHub, sent as github; its menu lists the webhook sources registered on this backend plus Custom), Event key (default issue_comment.created), Add Filter (one free-text filter input), Ask Agent, the notice Event sources need a public URL to deliver webhooks to this instance., and a Test event payload pre-filled with a JSON object for that source and key. A source the backend has not registered (menu Custom, then a typed name) adds Register this as a custom webhook source, checked by default.
  • F28.timeout: Add Timeout adds an optional Timeout seconds number field with a remove button; 1800 saves and the draft reads Ready to test.
  • F28.draft-save: Save draft works on any form, valid or not; the first save replaces the URL with ?draftId=<id>, shows the Draft saved bar (relative time, View test runs, Test) and the toast Draft saved in this conversation., and the save state reads Saved just now. The draft appears in the dashboard Drafts group (F21).
  • F28.draft-validation: the server validates on save, not on blur. An invalid draft is still saved (dispatchable: false) and its first error replaces Ready to test in the draft bar: an empty prompt shows Field required (also under Prompt), a bad custom cron shows Value error, Invalid cron expression: every day. A field error stays until the next save. Test stays enabled on a saved invalid draft: it saves again, opens Test runs with the same error in a red alert and dispatches nothing. The current validation error comes before any test status: after a successful draft Test the pill reads Latest test passed, and once an invalid cron is saved it reads the cron error (also after a reload, at desktop and phone widths) while the API marks the draft non-dispatchable.
  • F28.draft-save-error: a draft the server refuses outright (a timeout above 1800 returns 422) sets the save state to Save failed and shows one error toast with the reason the API gives (a timeout of 1801 reads Value error, timeout must not exceed 1800 seconds (30 minutes)). The draft bar drops its validity pill (no stale Ready to test) until a save succeeds.
  • F28.required-before-test: Test and Create check locally first and send nothing when a required field is empty: Add a prompt before continuing. (Prompt or Plugin kind), Add a plugin source before continuing., Add Python code before continuing., Add an entrypoint command before continuing., Add a setup script path before continuing., Add a setup script before continuing.; an event Test with a payload that is not a JSON object shows Enter a valid JSON object before testing this event automation. A blank Name is not an error: it is derived from the prompt.
  • F28.test-gated: in create mode Test stays disabled until the draft is saved and unchanged since; editing any field after a save disables it again until the next Save draft.
  • F28.draft-test: Test on a saved, valid draft opens Test runs (with Back), shows Test run started. and a Pending row; it runs a hidden disabled copy of the draft, not a dashboard automation. Expected: the row reaches Successful or Failed by itself. Known failure #18263 (reproduced again 2026-10-15 on a Custom Python draft): the row stays Pending and the page does not poll the runs after the first request. Known failure (reproduced once 2026-10-17, SDK1.55.1, OpenHands/software-agent-sdk#6024): gracefully restarting an owned deferred-init Agent Server during the Custom Test command can leave its persisted BashCommand without final BashOutput. Reopening Test runs → View logs showed RUNNING / (no output); two postrestart BashOutput searches returned zero. Expected: an interrupted command retains terminal status/output and Logs stops implying it is running. This is the shared F23/F28 RunLogsModal consumer; native Terminal, SIGKILL, phone and fix attribution were not verified.
  • F28.create: Create Automation creates the automation enabled, navigates to /automations/<id> (a Custom Python automation shows Script), and removes the draft from the dashboard Drafts group. Known failure (reproduced 2026-10-17, OpenHands/automation#594, automation 1.20.1, local SQLite WAL): successful writes can be invisible to the immediately following request on one keep-alive connection. A real no-pause client returned Upload not found on 3/50 upload201→create attempts and Automation not found on 2/50 create201→GET attempts. The separately exercised real UI sequence succeeded 21/21; no UI toast failure is claimed from the direct-service test. Expected: successful writes are visible to dependent requests without a delay. All test definitions used disabled inert events, were never dispatched, and were deleted with their uploads.
  • F28.error-contrast: the draft bar's error pill and the Test runs error alert use the theme's error color (text-feedback-error) and reach at least 4.5:1 in all five color themes. Their tints follow the same theme error color: the pill a 5% tint over the draft bar surface, the alert a 10% tint with a 40% border.

How to get to it (user POV)

  • Dashboard header Add Automation → Create Automation (automations-add-automation, then automations-add-automation-create): blank create mode. Every create recipe below starts here.
  • Empty dashboard Create Automation (automations-empty >> automations-create-automation): the same blank form (F21.empty-state).
  • Dashboard Drafts group: name or Resume (automation-setup-draft-resume-<draft-id>) and the pencil (Edit, automation-setup-draft-edit-<draft-id>) open ?draftId=<id>.
  • Kebab Edit on a dashboard card or the detail page header: edit mode (?automationId=<id>, F21.edit, F23.edit-open).
  • A direct URL with draftId or automationId (see the cold-load gotcha).

Driving it with control-openhands

Preconditions:

  • Baseline state (launch, doctor, onboard --skip). No LLM is needed: every bullet uses the Custom Python kind or never dispatches, and the agent-assisted path stays in F22.

  • Desktop viewport; the F28.error-contrast bullet switches color themes (Settings → Application, F16) and restores the default.

  • The original recipes were run on 2026-10-16 on a fresh local control-openhands launch of main with Agent Server 1.55.1 and no LLM; the blank-form, presets and error-contrast recipes were run again on 2026-10-17. The dated 2026-10-17 maintenance evidence separately proves the added regression checks and known-bug block. Documented known failures remain failures.

  • Blank form (F28.open-blank). Run control-openhands conversation list, control-openhands browser goto /automations, control-openhands browser click 'testid=automations-add-automation' and control-openhands browser click 'testid=automations-add-automation-create' --expect-url '/automations/setup$'. Then browser value 'testid=automation-setup-name' is New Automation, browser attr 'testid=automation-setup-name' placeholder is Standup digest, browser value 'testid=automation-setup-prompt' is empty, browser attr 'testid=automation-setup-frequency-daily' aria-checked is true, browser value 'testid=automation-setup-time' is 09:00, browser text 'testid=automation-setup-save-state' is Unsaved changes, browser enabled 'testid=automation-setup-test' is false, browser count 'testid=automation-setup-model' is 1 and browser count 'testid=automation-agent-profile' is 0; after control-openhands browser click 'testid=automation-setup-kind-custom' the agent profile count is still 0. conversation list is unchanged.

  • Presets (F28.schedule-presets). For each of once, hourly, daily, weekdays, weekly, custom run control-openhands browser click 'testid=automation-setup-frequency-<preset>' and control-openhands browser testids 'testid=automation-setup-at-row' (browser snapshot is an ARIA tree and does not list test ids): Once has automation-setup-datetime, Hourly only automation-setup-timezone, Daily and Weekdays automation-setup-time, Weekly also automation-setup-weekday (value 1), Custom automation-setup-custom-schedule. Click Weekly, then Custom: browser value 'testid=automation-setup-custom-schedule' is Weekly's 0 9 * * 1. Click Weekly, browser fill 'testid=automation-setup-time' 10:30, click Custom: 30 10 * * 1. Fill the Custom field with 15 8 * * 2 and click Custom again: it stays 15 8 * * 2. Click Daily, then Custom: 30 10 * * * (the preset's, not the typed cron). browser count 'testid=automation-setup-timezone >> option' is 13. Click Daily again.

  • Event fields (F28.event-trigger). Run control-openhands browser click 'role=radio[name=/^Event/]'. browser value 'testid=automation-setup-event-key' is issue_comment.created, browser visible 'testid=automation-setup-event-public-url-notice' is true, and browser count 'testid=automation-setup-custom-webhook-enabled' is 0 for github. Click testid=automation-setup-event-source-toggle, browser snapshot 'testid=automation-setup-event-source-menu' lists the registered sources and Custom (GitHub, GitLab, Slack, Linear, Jira on a local stack). Click testid=automation-setup-event-source-menu >> role=button[name="Custom"], browser fill 'testid=automation-setup-event-source' qa-hooks: browser visible 'testid=automation-setup-custom-webhook-enabled' is true and browser eval "document.querySelector('[data-testid=automation-setup-custom-webhook-enabled]').checked" is true. Pick GitHub again from the same menu. Click testid=automation-setup-add-event-filter (automation-setup-event-filter appears) and testid=automation-setup-event-test-payload-toggle; browser value 'testid=automation-setup-event-test-payload' is a JSON object with "source": "github" and "event": "issue_comment.created". Click role=radio[name=/^Schedule/] to return.

  • Invalid drafts save (F28.draft-save, F28.draft-validation). Fill testid=automation-setup-name with QA_F28 Probe, leave the prompt empty, browser network --clear, click testid=automation-setup-save-draft. browser wait-url 'draftId='; browser toasts --history includes Draft saved in this conversation.; browser text 'testid=automation-setup-draft-validity' is Field required; control-openhands api GET /api/automation/v1/drafts/<draft-id> (the id in the URL) has validation_errors [{"field":"prompt","code":"missing",…}] and dispatchable: false (browser network --bodies shows request bodies, not the response); browser text 'testid=automation-setup-save-state' is Saved just now. Now fill the prompt with Reply pong. Do not run any tools., click testid=automation-setup-frequency-custom, fill testid=automation-setup-custom-schedule with every day, browser network --clear, press Tab, and browser network --filter 'automation/v1' lists no request (no blur validation). Click Save draft: the validity text is Value error, Invalid cron expression: every day. browser network --clear, click testid=automation-setup-test: browser text 'testid=automation-setup-draft-runs-page' contains the same cron error, browser network lists only the draft PATCH (200) and nothing under dispatch; click testid=automation-setup-draft-runs-back. Fill the cron with 0 0 1 1 * and Save draft: it reads Ready to test.

  • Required fields before Test (F28.required-before-test). Run control-openhands browser fill 'testid=automation-setup-prompt' '', Save draft, browser network --clear, click testid=automation-setup-test: browser text 'testid=automation-setup-draft-runs-page' contains Add a prompt before continuing. and browser network --filter 'dispatch' lists nothing. Click testid=automation-setup-draft-runs-back, fill the prompt back in and Save draft.

  • Timeout (F28.timeout, F28.draft-save-error). Click testid=automation-setup-add-timeout, fill testid=automation-setup-timeout with 1800, Save draft: Ready to test. Fill 1801, browser toasts --history --clear, browser network --clear, Save draft. browser network --filter 'automation/v1/drafts' shows PATCH … 422 (--bodies adds the request body, not the response) and browser text 'testid=automation-setup-save-state' is Save failed. browser toasts --history holds one toast, Value error, timeout must not exceed 1800 seconds (30 minutes), and browser count 'testid=automation-setup-draft-validity' is 0. Click testid=automation-setup-timeout-remove and Save draft.

  • Test gating (F28.test-gated). After a successful Save draft browser enabled 'testid=automation-setup-test' is true; fill testid=automation-setup-name with QA_F28 Probe 2 and it is false; Save draft and it is true.

  • Custom kind and draft Test (F28.kind-toggle, F28.draft-test). Click testid=automation-setup-kind-custom and browser wait 'testid=automation-setup-custom-code'; once the crossfade ends browser count 'testid=automation-setup-prompt' is 0 (right after the click it can still read 1, and visible true) and browser value 'testid=automation-setup-custom-code' contains AUTOMATION_CALLBACK_URL. Click testid=automation-setup-custom-details-toggle: Entrypoint python3 main.py, Setup script path setup.sh. Save draft (Ready to test), click testid=automation-setup-test and browser wait 'testid=automation-setup-draft-run': the row reads Pending and the page shows Test run started. Expected: browser wait 'testid=automation-setup-draft-run >> text=Successful' --timeout 45000. Known failure #18263 (reproduced 2026-10-15): the row stays Pending for 45 s with a single runs request in browser network --filter '/runs'; after browser reload, testid=automation-setup-view-test-runs shows it Successful. Click testid=automation-setup-draft-runs-back. Switching back with testid=automation-setup-kind-prompt restores the Prompt; leave the draft on Custom for the next bullet.

  • Create (F28.create). Run control-openhands browser click 'testid=automation-setup-create' --expect-url '/automations/[0-9a-f-]{36}$'. The detail h1 is QA_F28 Probe 2, the badge reads Active and the page shows Script. browser goto /automations: browser count 'testid=automation-setup-draft-resume-<draft-id>' is 0.

  • Error contrast (F28.error-contrast). Switch to Light+ (F16), open a draft whose cron is every day (as in the invalid-drafts bullet), and browser screenshot 'testid=automation-setup-draft-details' --feature F28.error-contrast --name light-plus. Read the pill's computed color and backgroundColor with browser eval: the background is the text color at alpha 0.05 (Light+ rgb(192, 40, 45) and oklab(0.528 0.170 0.080 / 0.05)). Composite every ancestor's background down to the pill (painting each on a 1×1 canvas and reading the pixel normalizes oklab()), then the text color, and compute the WCAG ratio: at least 4.5:1. Click testid=automation-setup-test and inspect testid=automation-setup-draft-runs-error the same way: background alpha 0.1, borderTopColor alpha 0.4, same hue as the text. Repeat both checks in OpenHands-DeepSea, OpenHands-Neutral, OpenHands-Neo and Solarized Light, then restore OpenHands-Neutral. On 2026-10-17 the pill/alert ratios were Light+ 4.86/4.99, DeepSea 5.10/6.16, Neo and Neutral 4.86/4.95, Solarized Light 4.57/4.78.

  • Cleanup. Delete QA_F28 Probe 2 from its kebab and any leftover QA_F28 draft with its trash icon, as in F21; api GET /api/automation/v1/drafts lists none.

Preset-to-Custom regression check (F28.schedule-presets):

control-openhands browser viewport desktop
control-openhands browser goto /automations/setup
control-openhands browser wait 'testid=automation-setup-frequency-weekly'
control-openhands browser click 'testid=automation-setup-frequency-weekly'
control-openhands browser fill 'testid=automation-setup-time' '10:30'
control-openhands browser select 'testid=automation-setup-weekday' '3'
control-openhands browser click 'testid=automation-setup-frequency-custom'
control-openhands browser screenshot --feature F28.schedule-presets --name weekly-to-custom-proof
control-openhands assert --field value --equals '30 10 * * 3' -- browser value 'testid=automation-setup-custom-schedule'

Validation error after a passed Test (F28.draft-validation):

control-openhands browser viewport desktop
control-openhands browser goto /automations/setup
control-openhands browser fill 'testid=automation-setup-name' QA_Stale_Test_Success
control-openhands browser click 'testid=automation-setup-kind-custom'
control-openhands browser click 'testid=automation-setup-frequency-custom'
control-openhands browser fill 'testid=automation-setup-custom-schedule' '0 0 1 1 *'
control-openhands browser click 'testid=automation-setup-save-draft'
control-openhands browser hover 'testid=automation-setup-name'
control-openhands browser wait-url 'draftId='
QA_DRAFT_ID=$(control-openhands browser url | jq -r '.url|capture("draftId=(?<id>[a-f0-9-]+)").id')
trap 'control-openhands api DELETE "/api/automation/v1/drafts/$QA_DRAFT_ID" --write >/dev/null; control-openhands browser goto /automations >/dev/null' EXIT
control-openhands browser click 'testid=automation-setup-test'
control-openhands browser wait 'testid=automation-setup-draft-run'
QA_MATERIALIZED_ID=$(control-openhands api GET "/api/automation/v1/drafts/$QA_DRAFT_ID" | jq -r .body.materialized_automation_id)
QA_RUN_STATE=''
for QA_ATTEMPT in $(seq 1 20); do
  QA_RUN_STATE=$(control-openhands api GET "/api/automation/v1/$QA_MATERIALIZED_ID/runs?limit=10" | jq -r '.body.runs[0].status // ""')
  [ "$QA_RUN_STATE" = COMPLETED ] && break
  sleep 3
done
[ "$QA_RUN_STATE" = COMPLETED ]
control-openhands browser reload
control-openhands browser text 'testid=automation-setup-draft-validity'
control-openhands browser fill 'testid=automation-setup-custom-schedule' 'every day'
control-openhands browser click 'testid=automation-setup-save-draft'
control-openhands browser hover 'testid=automation-setup-name'
control-openhands browser reload
control-openhands assert --field body.dispatchable --equals false -- api GET "/api/automation/v1/drafts/$QA_DRAFT_ID"
control-openhands browser screenshot --feature F28.draft-validation --name validation-after-test
control-openhands assert --field text --equals 'Value error, Invalid cron expression: every day' -- browser text 'testid=automation-setup-draft-validity'

Gotchas

  • A toast can cover the toolbar (Save draft, Test, Close) and stays while the pointer rests on it, so the next toolbar click times out ("subtree intercepts pointer events"). After each save, browser hover a form field (for example testid=automation-setup-name) before clicking the toolbar again, as F22's Gotchas say.
  • Drive inputs with browser fill: setting .value from browser eval does not reach React state for every field, and a save then sends the old value.
  • Change one field per Save draft when checking a validation message: a save shows only the first server error, so two edits in one save hide the second.
  • A cold load of /automations/setup?draftId=<id> or ?automationId=<id> (a reload or a typed URL) opens the form: re-checked 2026-10-14 on a control-openhands launch of main with this family (both read their Name back). An earlier instance of unknown build stayed on Loading saved draft… for more than 20 s; if that returns, compare with opening the same draft from the dashboard.
  • The draft bar duplicates the prompt error: Field required appears both under Prompt and in the bar.
  • Kebab Edit on a Custom Python (tarball) automation shows the Existing code bundle summary, not the code editor, and Save keeps that bundle without asking for upload-time fields (F23.edit-open, F23.edit-save).
  • Escape on the setup page does nothing, by design (F23.edit-close).