Open to work
All projects Case study

Ace

AI teammates that do the work on their own cloud computer, and ask you before important actions.

Status
Live
Stack
Next.js, Trigger.dev, Daytona, PostgreSQL, Vercel AI SDK
Models
Anthropic, OpenAI, Google, OpenAI-compatible
Demo at
ace.smangrati.com

Overview

Ace lets you hand work to AI teammates in a chat. Each teammate has its own cloud computer, a Linux desktop with a browser, a terminal and files that stay between chats, and it does the task there while you watch or get on with something else.

I built it for people who are not technical. They shouldn't need to know what a model or a tool call is, so the app talks like a workplace: teammates have jobs, you chat with them, and you choose what they need your permission for. When a step needs you, such as a password or a sign-in code, you take over the screen and hand it back.

You bring your own key for Anthropic, OpenAI, Google or any OpenAI-compatible server, and your provider bills you for the model calls. That leaves a host with three bills: Daytona for the computers, Trigger.dev for the worker, and the database. The web app and PostgreSQL run with Docker Compose, so Ace is built to self-host.

Try the demo

The demo has no sign-up. The sign-in page fills in a shared demo account for you.


Decisions

What was hard

  1. 01 Where a turn runs

    A turn can run for hundreds of steps, and it can stop for up to a day while it waits for your approval. A Next.js route times out in minutes and stops when you close the tab, so I moved turns into a Trigger.dev worker. Trigger.dev suspends a run while it waits, and a day-long wait costs no compute.

    The browser reads the reply straight from the Trigger.dev session, with a token for that one chat. The web app holds no open connections, and a redeploy in the middle of a reply does not cut it off.

  2. 02 One computer, and a lock that outlives the process

    Each teammate keeps one Daytona sandbox for all its chats, so its files and installed software carry over. Two turns on one desktop would click over each other, so only one turn may use it at a time. That lock took more thought than anything else in Ace.

    A PostgreSQL advisory lock belongs to a database connection, and a run suspended for a day holds no connection. A Trigger.dev queue with a concurrency of 1 limits whole runs, and one chat run stays open across many turns, so a second chat would wait behind an idle one. I ended up with a lease in two columns on the sandbox row. The turn that holds it renews it every 20 seconds and it expires after 60, so a crashed worker frees the computer within a minute. Waiting turns sleep on Trigger.dev wait tokens, and the chat shows "Up next".

  3. 03 Asking less, about the right things

    If a teammate asks before every action, people learn to click Allow without reading. So you pick which kinds of action need your answer, and a separate check looks for risky ones in every mode, "Work without asking" included.

    Fixed rules run first and cost nothing. They catch reading .ssh or .env files, force pushes, payment APIs, wiping a disk and typing a card number. Rules cannot tell "click Buy" from "click Next", so shell commands, screen actions and file writes outside the work folders also go to a cheap model from your own provider, such as Haiku, with the last screenshot attached. If that judge errors or takes longer than 20 seconds, Ace asks you.

  4. 04 Recovering from a crash without repeating anything

    A click or a shell command can have effects that Ace cannot see or undo. If a worker dies mid-call, Ace has no way to know whether an email went out, and a retry could send it twice. So Ace writes each tool call to a ledger before it runs and adds the result after. The next turn finds the calls with no result, marks them interrupted, and tells the teammate to look at the computer before it tries again. The check costs a step or two.

  5. 05 One database to back up

    For a self-host I wanted one command to start and one thing to back up. Docker Compose starts PostgreSQL 17, pushes the Drizzle schema, then starts the Next.js server. Pictures and screenshots go into PostgreSQL as bytea, which works because they stay small: pictures stop at 256 KB, and screenshots are JPEGs at quality 70. Better Auth keeps its tables in the same database, and so does the chat transcript, which Trigger.dev would otherwise keep in its own storage.

    Only the last 3 screenshots go back to the model, so a long turn does not resend every screen it has seen.


Stack

What it runs on

Frontend
Next.jsReactTypeScriptTailwindnoVNC
Backend
Trigger.devVercel AI SDKPostgreSQLDrizzleBetter Auth
Models
AnthropicOpenAIGoogleOpenAI-compatible
Infrastructure
DaytonaDockerVercelGitHub ActionsLangfuse
Testing
VitestPGliteTesting Library