Skip to content

proposal(scheduled-tasks): first-class Scheduled Tasks - #3236

Closed
reachjalil wants to merge 34 commits into
different-ai:devfrom
reachjalil:feature/scheduled-tasks
Closed

proposal(scheduled-tasks): first-class Scheduled Tasks#3236
reachjalil wants to merge 34 commits into
different-ai:devfrom
reachjalil:feature/scheduled-tasks

Conversation

@reachjalil

@reachjalil reachjalil commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Important

Draft working candidate. The current product path is implemented and available for iteration. This is not a request to merge or a claim of release readiness.

Working deliverable

Scheduled Tasks has one independently useful outcome:

Create a workspace-scoped task as a disabled draft, review its exact authority, run it once in a fresh linked session, and inspect its durable receipt and artifacts.

The feature is behind the Scheduled Tasks feature flag. It appears as one top-level destination above Library, aggregates tasks across workspaces, and always shows the human-readable workspace while preserving workspace-scoped creation, authority, and execution.

Current product scope

  • Compact desktop master-detail UI with search and All/Active/Paused filters; narrow windows use list-to-detail navigation.
  • Human-readable task rows for name, schedule/next run, state, and workspace, with suggestions below the user's tasks.
  • Selected-task controls for Run once, Enable/Pause/Resume, editing, overflow actions, authority review, run history, linked sessions, artifacts, and immutable receipts.
  • OpenWork components, typography, spacing, simple clock iconography, and in-app confirmation modals rather than native alert windows.
  • Chat can propose a disabled Scheduled Task draft through scheduled-task.propose-draft; the capability documents exact manual/daily/weekly schedule shapes.
  • Weekly schedules render localized weekday names such as Fri, not raw day indexes.
  • The closed utility rail stays closed and compact; task content does not force it open.

Architecture boundary

  • packages/scheduled-tasks owns engine-neutral contracts, ports, schedule calculation, state transitions, tick planning, and reusable testing utilities.
  • The portable core does not import OpenCode, app UI, server routes, or SQLite infrastructure.
  • apps/server/src/scheduled-tasks owns the OpenWork adapter layer: persistence, workspace validation, execution, artifacts, scheduler lifecycle, and routes.
  • OpenCode is isolated behind opencode-execution-adapter.ts.
  • One feature module owns Scheduled Tasks composition and lifecycle; the server composition root creates, registers, starts, and stops it.
  • The app consumes a narrow ScheduledTasksClient contract.

Architecture and repository-conformance tests protect this separation.

Safety contract

  • Draft creation grants no authority and cannot enable recurrence.
  • Review binds exact workspace roots, capabilities, action classes, model/agent choice, runtime ceiling, expiry, and fixed denials.
  • Every run gets a fresh managed session and immutable run/attempt receipt.
  • External communication, destructive operations, self-modification, task mutation, native shell/edit tools, and unattended approval remain denied.
  • Permission questions or authority loss fail closed into typed needs-attention states.
  • Parent PR execution runs only while OpenWork is open. Closed-app and Den execution are separate runtime layers, not claims of this parent.

Exact integration state

  • PR head: 37037cc02c6ca5a66b18a8f0cbc469fa023fa385.
  • Exact synchronized different-ai/openwork:dev: c8adbe717ac6abcc4a43472a4bb69d879dbf2ef3.
  • The only sync conflict was apps/server/src/server.ts; the resolution preserves the Scheduled Tasks stop-on-startup-failure lifecycle alongside current dev behavior.
  • Local review build: mix-tape@5f9c6159e67761638960219ae491f510f4f0d93e, whose tree exactly matches the PR head. The Electron app is running from that candidate.

Checks on the current head

  • pnpm install --frozen-lockfile — passed with pinned pnpm 11.4.0.
  • pnpm --filter @openwork/app typecheck — passed.
  • pnpm --filter openwork-server typecheck — passed.
  • node scripts/i18n-audit.mjs --ci — passed; no dangling or dynamic Scheduled Tasks keys.
  • Twelve focused chat-affordance, weekday-format, and architecture checks — passed.
  • git diff --check and exact base/PR ancestry — passed.
  • Desktop development startup, including shared types, portable package, server build, Electron 43 native dependency rebuild, and workspace load — passed.

The earlier 69-test focused suite and real Electron chat → proposal card → review journey remain useful prior-head provenance. They were not rerun on this synchronization checkpoint; broad verification is deferred until the iteration direction is selected.

Known gates and overlap

Non-goals

  • Advanced cron syntax, webhook/event/email triggers, arbitrary workflow DSLs, multi-agent DAGs, or organization-wide automation administration.
  • Automatically authorizing external communication or destructive operations.
  • Marking this draft ready, requesting review, merging, releasing, or deploying as part of this checkpoint.

@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

@reachjalil is attempting to deploy a commit to the Different AI Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
openwork-landing Ready Ready Preview, v0 Aug 4, 2026 12:25pm

@reachjalil

Copy link
Copy Markdown
Collaborator Author

Complete Scheduled Tasks experience proposal

The comprehensive proposal and Fraimz are now hosted on Vercel:

Open the complete 22-frame experience proposal

It documents discovery, form and chat creation, schedule preview, immutable editing, authority before/after review, run-once and cancellation, durable receipts, exact session/artifact links, enabling and deterministic execution, notifications, restart recovery, upcoming grouping, denied authority, needs-attention, repair, resume, pause, all UI states/controls, threat boundaries, migration/rollback, and non-goals.

  • Exact revision: 319e15bd394a3d2fea4d548ecd4f1f951d703df5
  • Final evidence run: 2026-07-28T16-19-05-022Z
  • Result: 7/7 journey steps and 22/22 Fraimz frames passed
  • Generated Fraimz
  • Raw eval report

Representative frames

Disabled proposal:

Disabled natural-language Scheduled Task proposal

Reviewed authority boundary:

Reviewed Scheduled Task authority

Immutable run receipt with session and artifact:

Completed Scheduled Task receipt

Denied unattended work fails closed:

Scheduled Task needs attention

Paused final overview:

Paused Scheduled Task overview

The requester has not manually confirmed the behavior. The PR remains draft. Latest upstream/dev moved after the evidence run and currently needs a deliberate session-page.tsx conflict resolution plus a new exact-revision verification pass before merge readiness.

@reachjalil reachjalil changed the title feat: add first-class Scheduled Tasks proposal(scheduled-tasks): first-class Scheduled Tasks Jul 28, 2026
# Conflicts:
#	apps/app/src/react-app/domains/session/chat/session-page.tsx
#	apps/app/src/react-app/shell/app-root.tsx
#	apps/app/src/react-app/shell/notification-center.tsx
#	apps/app/src/react-app/shell/session-route.tsx
#	apps/app/src/react-app/shell/use-workspace-route-state.ts
#	apps/server/src/server.ts
@reachjalil

Copy link
Copy Markdown
Collaborator Author

Scheduled Tasks runtime stack is ready

The original portable extraction remains the foundation at 7352171. The parent branch is now a0248a6, which preserves that commit and contains current upstream dev d1b5caf.

Two ready, parallel child PRs are layered directly on feature/scheduled-tasks:

  • Local background runtime: feat(scheduled-tasks): run reviewed tasks while the app is closed reachjalil/openwork#20

    • Head 5186df5
    • Value: a reviewed task runs on this Mac while the OpenWork window is closed.
    • Reuses the same SQLite/config/runtime and keeps launchd policy-free.
    • Mergeable and current with this parent; legacy-flow guard green.
  • Den remote runtime: feat(scheduled-tasks): run reviewed tasks in Den reachjalil/openwork#22

    • Head d450f3d
    • Value: a reviewed task runs in Den while every personal OpenWork client is offline.
    • Keeps the portable package clean, puts Den wire contracts in @openwork/scheduled-tasks-den, and implements the same repository port with a tenant-bound MySQL adapter.
    • Mergeable and current with this parent. All started GitHub checks are green; the Den DB and enterprise contract jobs remain queued without runner steps on the fork.
    • Equivalent local proof is green, including disposable MySQL 8.4 with 5 tests / 25 expectations, migration convergence, and the enterprise mock contract workflow with 212 package tests plus 20 lab tests.

The child diffs do not overlap and can land independently into feature/scheduled-tasks. Neither changes the other runtime driver or the Scheduled Tasks UI.

Deployment proof still required:

  • Local: signed/notarized macOS artifact plus quit/sleep/wake acceptance.
  • Den: live Den/Daytona/Vercel/self-hosted offline-device acceptance.

PR #3236 itself still has the existing legacy-flow guard failure for evals/flows/scheduled-tasks-e2e.flow.ts and fork-only Vercel authorization failures. Those are parent-PR issues, not child-runtime failures.

# Conflicts:
#	apps/server/src/server.ts

Copy link
Copy Markdown
Collaborator Author

Superseded by #3501 on canonical branch different-ai/openwork:codex/scheduled-tasks at the exact reviewed head 37037cc02c6ca5a66b18a8f0cbc469fa023fa385. Closing this fork-backed review surface so future iteration and CI happen in the upstream repository. The fork branch and PR history remain available; runtime child PRs reachjalil#20 and #22 are unchanged.

@reachjalil reachjalil closed this Aug 4, 2026
reachjalil added a commit that referenced this pull request Aug 5, 2026
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>
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