Skip to content

feat(automations): propose an Automation from chat - #3552

Merged
reachjalil merged 1 commit into
devfrom
feature/automations-from-chat
Aug 5, 2026
Merged

feat(automations): propose an Automation from chat#3552
reachjalil merged 1 commit into
devfrom
feature/automations-from-chat

Conversation

@reachjalil

Copy link
Copy Markdown
Collaborator

Why

Asked to "create a test automation that prints hello every 5 minutes," the in-app agent had no idea Automations exist. It read the workspace, found leftover shell scripts, said "I see the existing pattern — they use launchd plists", and started writing one. Nothing in the product told it there is a scheduler, so it improvised an OS-level cron the user cannot see or manage from the app.

This teaches the agent the feature and gives it a safe way to hand one over.

What changed

Three layers, following the shape closed PR #3236 used for Scheduled Tasks:

Knowledge — an ## Automations section in the capabilities prompt: what Automations are, that recurring work goes through openwork_execute id automation.propose, and an explicit prohibition on scheduling OpenWork work with cron, launchd, systemd, or Task Scheduler. It carries the exact once/daily/weekly shapes (hours 0-23, minutes 0-59, weekdays 0=Sunday), says there is no interval schedule and to offer the closest supported cadence plus Run now instead, and states the two honesty constraints: proposing is not creating, and an occurrence is durably missed when no desktop runner is connected.

Affordance — a new automations feature contribution exposing automation.propose. It validates arguments against the shared contract and returns the proposal. It does no I/O at all — no Den call, no local server call, { data: "none", ui: "none", external: false }. Automations are active from the moment they exist and the Den credential lives in the renderer, so an agent can describe an Automation but only a person can create one. A test asserts zero requests reach the fake backend.

Card — the proposal renders in the thread with its schedule and instructions behind a Create Automation button that uses the renderer's own Den session and active org, then links to the Automations view. It explains itself when the preview flag is off or Cloud is signed out rather than failing on click.

scheduleLabel/formatTime move out of automations-page.tsx into automation-format.ts so the card and the page label schedules identically.

Trying it

With the Automations preview on and Cloud signed in, ask a thread for something recurring — "check my Slack every morning and summarize the last message." The agent proposes; you create.

Asking for "every 5 minutes" now gets an honest answer about intervals instead of a launchd plist.

Checks

Run on 477ff9b82:

  • pnpm --filter @openwork/app typecheck — passed
  • pnpm --dir apps/server typecheck — passed
  • Server plugin suites (adapters, capabilities knowledge, extensions preview) — 23 passed
  • App Automations suites incl. the new proposal-card test — 4 passed
  • Full app suite — 646 passed, 2 failed; both are message-list-loading failures that reproduce identically on unmodified dev (645 tests, same 2 failures) and only under full-suite --isolate. Not introduced here, and not claimed as passing.

No dependency changes, so pnpm-lock.yaml is untouched.

Notes for review

  • The card detects automation.propose by parsing the openwork_execute result rather than adding a dedicated tool, so no new tool surface appears in the model's tool list.
  • Proposal-only is a deliberate boundary, not a v1 shortcut: chat-created active automations would let any content an agent reads schedule recurring work. Worth keeping even if Automations later gain a draft state.
  • Follow-up worth considering: the card's copy is hardcoded English, matching the existing Automations UI, which is outside the i18n audit's key inventory.

🤖 Generated with Claude Code

Asked for recurring work, the in-app agent had no idea Automations exist:
it read the workspace, found leftover shell scripts, and started writing a
launchd plist. Nothing told it the product has a scheduler.

Three layers, following the shape closed PR #3236 used for Scheduled Tasks:

- Knowledge: an Automations section in the capabilities prompt. It names
  the feature, forbids scheduling OpenWork work through cron/launchd/systemd/
  Task Scheduler, gives the exact once/daily/weekly shapes, and states the
  two honesty constraints — proposing is not creating, and an occurrence is
  missed when no desktop runner is connected.
- Affordance: an `automations` contribution exposing `automation.propose`.
  It validates against the shared contract and returns the proposal. It does
  no I/O at all: Automations are active the moment they exist and the Den
  credential lives in the renderer, so an agent can describe one but only a
  person can create one.
- Card: the proposal renders in the thread with its schedule and
  instructions behind a Create button that uses the renderer's own Den
  session, and explains itself when the preview flag is off or Cloud is
  signed out.

`scheduleLabel`/`formatTime` move from the Automations page into
automation-format so the card and the page label schedules identically.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openwork-app Ready Ready Preview Aug 5, 2026 8:09am
openwork-den Ready Ready Preview Aug 5, 2026 8:09am
openwork-den-worker-proxy Ready Ready Preview Aug 5, 2026 8:09am
openwork-diagnostics Ready Ready Preview Aug 5, 2026 8:09am
openwork-landing Ready Ready Preview, v0 Aug 5, 2026 8:09am

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Warden security clearance: clear. No new security issues found in this diff (477ff9b821cb44f2572cf81e525d16771445cd79). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@reachjalil
reachjalil merged commit 4d50c7f into dev Aug 5, 2026
26 checks passed
@reachjalil
reachjalil deleted the feature/automations-from-chat branch August 5, 2026 08:16
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.

1 participant