Add Background Agents (Open-Inspect) teardown.

544bb6e8b9d8 · AtlantisPleb · · parent e23a34eb11b1

Add Background Agents (Open-Inspect) teardown.

Document the Cloudflare + Modal + Next.js background-coding-agent
infrastructure and contrast it with the Phoenix `openagents.com` and the
`openagents` Node/Effect monorepo. The teardown pins commit
703c34109054198b0b07dfec3b7b5700c854e22a and identifies harvestable
patterns (provider-neutral control plane/data plane split, GitHub App
credential brokering, named environments) and rejected pieces
(single-tenant auth, Cloudflare Durable Objects as the product store,
Modal as the only authority).

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By
Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

Deploy story

What this commit did to the running system — joined from the forge receipt chain, the part a commit page elsewhere cannot show.

Not deployed through the forge lane

No push, promotion, build, or deploy receipt references this commit (receipts are scanned over a bounded recent window). Changes shipped by full node replacement carry their proof in the release gate receipt instead.

Changed files

  • added docs/teardowns/2026-08-24-background-agents-open-inspect-teardown.md

Diff

1 file changed, +177 -0

docs/teardowns/2026-08-24-background-agents-open-inspect-teardown.md added +177

@@ -0,0 +1,177 @@

1
# Background Agents (Open-Inspect) teardown — 2026-08-24
2
3
Read-only architecture and product audit of the public `ColeMurray/background-agents` repository, also published as Open-Inspect. The local reference clone lives at `~/work/projects/repos/background-agents`. Nothing in the tree was modified, built, or executed. No Open-Inspect account or cloud resources were provisioned. The MIT license permits study but not blind code reuse.
4
5
Episode calibration: this audit focuses on the infrastructure and session model, not on the agent model or UI details. It compares Open-Inspect to the Phoenix-era `openagents.com` repository and to the current `openagents` Node/Effect monorepo.
6
7
Evidence labels (per [README](./README.md)):
8
9
- **`[source]`** — tracked source, docs, manifests, or config at the commit.
10
- **`[history]`** — Git history at or before the audited commit.
11
- **`[public]`** — corroborated by a linked public source.
12
- **`[inferred]`** — reasoned from several observations.
13
- **`[limitation]`** — a boundary on what this audit can prove.
14
15
## TL;DR
16
17
Open-Inspect is a single-tenant, Cloudflare-native background coding-agent service. A Next.js web client and three Hono bot Workers feed a Cloudflare Workers control plane; each session lives in its own Durable Object with SQLite state and a WebSocket hub; a Modal Python data plane runs the agent in a Debian container with OpenCode, git, browser automation, and a WebSocket bridge. [source] [docs]
18
19
The five most important findings:
20
21
1. **The session is the durable unit, and it is pinned to a Cloudflare Durable Object.** SQLite in the DO holds messages, events, participants, artifacts, and the sandbox reference. This is a strong per-session isolation model, but it makes multi-region presence, long-lived replay, and cross-session search dependent on Cloudflare's DO fabric. The Phoenix `openagents.com` application keeps product truth in PostgreSQL and uses LiveView assigns and PubSub as projections; the `openagents` monorepo is moving toward Cloud SQL Postgres and Cloud Storage as the durable authority. [source] [docs]
22
2. **Modal owns the sandbox, not the control plane.** Image builds, sandbox lifecycle, snapshots, and the in-sandbox agent runtime are delegated to Modal. The control plane treats the data plane as a provider: create, start, snapshot, terminate, delete. This is the same provider boundary the `openagents` `managed-sandbox-contract` describes, but Open-Inspect has one concrete provider (`modal-infra`) while OpenAgents has not yet pinned a single background-sandbox provider. [source] [docs]
23
3. **The single-tenant security model is explicit and narrow.** All users share one GitHub App; the App's installation scope defines repo access. PR attribution uses the user's OAuth token when available, otherwise falls back to the bot. This matches an internal-tools assumption, not a multi-tenant SaaS. OpenAgents' `openagents.com` Phoenix application treats repository access as a per-account, server-side authorization decision. [source] [docs]
24
4. **WebSocket streaming is the primary real-time contract.** Clients join a session WebSocket and receive events as the agent runs. This is a clean streaming model, but it couples clients to the DO hibernation lifecycle and to Cloudflare's edge routing. The Phoenix product uses LiveView WebSockets with PostgreSQL-backed event journals; the `openagents` monorepo's sync contracts use a separate sync schema and worker layer. [source] [docs]
25
5. **The repository is a fast-moving, pre-1.0 monorepo with heavy Cloudflare and Modal coupling.** The version is `0.1.0` and the Terraform, D1 migrations, and Modal image build paths are the real deployment authority. It is a useful pattern donor for a single-tenant background-agent lane, not a drop-in subsystem for the multi-tenant OpenAgents product. [source] [history]
26
27
## 1. Snapshot, provenance, and limitations
28
29
### 1.1 Exact source identity
30
31
| Field | Value |
32
| --- | --- |
33
| Public repository | `https://github.com/ColeMurray/background-agents` |
34
| Local clone | `~/work/projects/repos/background-agents` |
35
| Audited commit | `703c34109054198b0b07dfec3b7b5700c854e22a` |
36
| Commit time | 2026-08-23 22:48:54 -0700 |
37
| Commit subject | `ci: skip checks for documentation-only changes (#1590)` |
38
| License | MIT |
39
| Product name | Open-Inspect |
40
| Version | `0.1.0` (`package.json`) |
41
| Languages | TypeScript (Node 22+), Python 3.12 |
42
| Package manager | npm workspaces |
43
| Primary runtimes | Cloudflare Workers + Durable Objects, Modal, Next.js |
44
45
[source]
46
47
### 1.2 What was probed and what was not
48
49
This audit read tracked source, checked-in docs, `package.json`, `terraform/`, and the `packages/control-plane`, `packages/web`, and `packages/modal-infra` READMEs. It did not execute the web app, control plane, bot Workers, or Modal sandbox. It did not create an Open-Inspect deployment or cloud account. Claims about runtime behavior, performance, and cost are inferred from source and docs, not measured. [limitation]
50
51
## 2. Architecture
52
53
Open-Inspect is three tiers joined by WebSockets.
54
55
```text
56
Clients (Next.js web, Slack, GitHub, Linear, webhooks)
57
        |
58
        v
59
Control Plane (Cloudflare Workers + Durable Objects)
60
  - API gateway
61
  - One Durable Object per session
62
    - SQLite (messages, events, participants, artifacts, sandbox ref)
63
    - WebSocket hub with hibernation
64
    - Event stream
65
    - GitHub integration
66
  - D1 (session index, repo metadata, environments, encrypted secrets)
67
        |
68
        v
69
Data Plane (Modal)
70
  - Debian + Node 22 + Python 3.12 + uv
71
  - OpenCode CLI
72
  - agent-browser + headless Chrome
73
  - Supervisor / bridge WebSocket back to control plane
74
```
75
76
[source] [docs]
77
78
### 2.1 Control plane
79
80
The control plane is `packages/control-plane`, a Cloudflare Worker. Each session is a Durable Object. The DO stores:
81
82
- session state
83
- participants
84
- messages
85
- events
86
- artifacts
87
- sandbox reference
88
- `ws_mapping` for WebSocket clients
89
90
D1 stores the session index, repository metadata, environments, automations, image builds, and encrypted secrets. The API includes `POST /sessions`, `POST /sessions/:id/prompt`, `POST /sessions/:id/pr`, `POST /sessions/:id/scm-credentials`, and `WebSocket /sessions/:id/ws`. [source] [docs]
91
92
### 2.2 Data plane
93
94
The data plane is `packages/modal-infra`, a Python/Modal application. It builds a base image with Debian, git, build-essential, Node 22, pnpm, Bun, Python 3.12 with uv, the OpenCode CLI, and `agent-browser` with headless Chrome. A sandbox runs a supervisor (`entrypoint.py`), an OpenCode server, and a bridge (`bridge.py`) that connects back to the control-plane WebSocket. [source] [docs]
95
96
### 2.3 Clients
97
98
- `packages/web`: Next.js 16 + React 19, Vercel or Cloudflare Workers (OpenNext).
99
- `packages/slack-bot`, `packages/github-bot`, `packages/linear-bot`: Hono Workers that create sessions from external events.
100
- `packages/shared`: shared types for the TypeScript packages.
101
102
[source]
103
104
## 3. Comparison to OpenAgents
105
106
### 3.1 Durable authority
107
108
Open-Inspect: SQLite in a Cloudflare Durable Object is the session's durable store. D1 is the relational index. The session is the primary durable boundary.
109
110
Phoenix `openagents.com`: PostgreSQL is the durable authority for product, authorization, work, and deployment state. LiveView socket assigns, PubSub messages, and BEAM processes are projections.
111
112
`openagents` Node/Effect monorepo: Cloud SQL Postgres and Cloud Storage are the durable authority. The `sync-schema`/`sync-client`/`sync-worker` packages project bounded subsets to clients. The `managed-sandbox-contract` defines a runtime-neutral durable sandbox lifecycle but does not itself choose a provider.
113
114
Implication: Open-Inspect's DO-per-session model is a strong fit for ephemeral, edge-coupled background work. OpenAgents' Postgres-first model is a better fit for cross-session search, long-lived work graphs, and multi-tenant authorization. [inferred]
115
116
### 3.2 Compute and sandbox model
117
118
Open-Inspect: Modal is the concrete sandbox provider. The control plane calls Modal for create, start, snapshot, terminate, and delete. Modal images, secrets, and snapshots are the data plane's deployment authority.
119
120
Phoenix `openagents.com`: BEAM processes and connected computers are the execution surface. There is no equivalent cloud sandbox provider in the Phoenix architecture.
121
122
`openagents` monorepo: `managed-sandbox-contract` and `cloud-contract` define a provider-neutral sandbox lifecycle (identity, lease, budget, command, event, receipt, artifact). Pylon is an earning-capable node, not a background coding sandbox. No single provider like Modal is pinned today.
123
124
Implication: Open-Inspect is a complete, concrete sandbox integration. OpenAgents has the contract layer but needs a provider adapter to match the Modal integration. Harvest the control-plane/provider split, not the Modal-specific code. [source] [docs]
125
126
### 3.3 Tenancy and authorization
127
128
Open-Inspect: explicitly single-tenant. One GitHub App handles all git operations; the App's installation scope defines which repositories are reachable. The control plane does not validate per-user repo access before creating a session. Users may sign in with GitHub or Google; PRs use the user's OAuth token when available, otherwise fall back to the bot. [source] [docs]
129
130
Phoenix `openagents.com`: multi-tenant. GitHub token storage is per-account and encrypted; repository access is a server-side authorization decision. The forge is the canonical Git remote and GitHub is a mirror.
131
132
`openagents` monorepo: OpenAuth, Google Cloud, and the OpenAgents identity model. Provider-account and repository grants are typed and server-side.
133
134
Implication: Do not import Open-Inspect's single-tenant auth into OpenAgents' multi-tenant surface. The GitHub App token brokering and git credential helper are useful pattern donors for an internal/team lane, not the public product. [source] [inferred]
135
136
### 3.4 Real-time and client contract
137
138
Open-Inspect: clients open a WebSocket to the session DO and receive a stream of events as the agent runs. This is the entire real-time contract. Web, Slack, GitHub, and Linear all create or consume through the same control plane.
139
140
Phoenix `openagents.com`: LiveView keeps browser state over a WebSocket, but durable event journals in PostgreSQL are the authoritative conversation record. API clients observe the same journal.
141
142
`openagents` monorepo: Effect-native sync schema with separate sync client and worker; the browser and worker share typed schemas, not a raw WebSocket. Cloud Run and Cloud Storage are the transport/storage authorities.
143
144
Implication: Open-Inspect's WebSocket-per-session is a simple, low-latency choice for a small number of concurrent sessions. OpenAgents' typed sync and Postgres journals are a better fit for durable, searchable, multi-device history. [inferred]
145
146
### 3.5 Web framework
147
148
Open-Inspect: Next.js 16 / React 19, with an option to deploy to Cloudflare Workers via OpenNext or to Vercel. The control plane and bot Workers are Hono on Cloudflare Workers.
149
150
Phoenix `openagents.com`: Phoenix 1.8, LiveView, HEEx, Tailwind, Basecoat. Elixir/OTP is the runtime and BEAM is the execution cluster.
151
152
`openagents` monorepo: TanStack Start, Effect, and Effect Native for retained surfaces; Node 24 on Cloud Run; pnpm workspaces. The old Foldkit/Tailwind app is deleted.
153
154
Implication: There is no web-framework overlap worth copying. Open-Inspect's web client is a standard Next.js dashboard; OpenAgents has moved past that toward Effect Native. [inferred]
155
156
## 4. What to harvest and what to reject
157
158
### 4.1 Harvest
159
160
- **Concrete background-agent deployment as a provider.** The control-plane/data-plane split and the use of a cloud sandbox provider (Modal) as a black box is a useful reference for the `managed-sandbox-contract` provider adapter work. [inferred]
161
- **GitHub App token brokering.** The `scm-credentials` endpoint and the in-sandbox git credential helper pattern are a clean way to issue short-lived tokens without storing long-lived secrets in the sandbox. [source]
162
- **Environment-as-a-named-workspace.** The concept of a saved, reusable repository set with secrets and optional prebuilt images is a useful product primitive. [source] [docs]
163
- **Single-session WebSocket hub with hibernation.** For a small, single-tenant deployment, the per-session DO + SQLite + WebSocket hub is a compact real-time architecture. [source] [docs]
164
- **Provider-neutral scheduling of image builds.** The control plane schedules image builds and the data plane only executes short-lived create/start/snapshot/terminate/delete operations. [source] [docs]
165
166
### 4.2 Reject
167
168
- **Single-tenant auth as the default.** The shared GitHub App and the absence of per-user repo access validation are incompatible with OpenAgents' multi-tenant, account-scoped data-rights model. [source] [docs]
169
- **Modal as the only authority.** Modal is a vendor-specific data plane. OpenAgents' `cloud-contract` and `managed-sandbox-contract` are designed to allow multiple providers; do not hard-code Modal semantics into product code. [source] [inferred]
170
- **Cloudflare Durable Objects as the durable product store.** DO SQLite is a session cache, not the cross-session authority. OpenAgents' PostgreSQL receipts and Cloud SQL remain the durable source. [inferred]
171
- **Unbounded shared GitHub App scope.** The product's security model depends on limiting the App's installation to trusted repos. OpenAgents must enforce per-account, server-side repo grants. [source] [docs]
172
173
## 5. Positioning
174
175
Open-Inspect is the most complete public single-tenant background coding-agent system in the local reference set. It is a pattern donor, not a code donor: the MIT license permits copying, but the Cloudflare + Modal + Vercel stack is not OpenAgents' chosen runtime. The useful OpenAgents adaptation is a bounded background-sandbox provider adapter and a single-session real-time contract for internal or team-facing lanes, not a wholesale merge of the control plane or auth model.
176
177
[source] [inferred] [limitation]

This page updates live while a promote is in flight · changelog