Move to threads based system.

This commit is contained in:
Gabriel Brown
2026-06-22 10:37:26 -04:00
parent 8ae6c4b533
commit 206b64176b
82 changed files with 6169 additions and 1930 deletions
+19 -3
View File
@@ -27,19 +27,23 @@ Implemented today:
- Per-user OpenAI settings for upstream compatibility review.
- Per-Spoon encrypted project secrets and agent runtime settings.
- Optional `apps/agent-worker` service that can claim queued jobs, clone the
GitHub fork, ask OpenAI for bounded file edits, run checks, push a branch, and
open a draft PR.
GitHub fork, keep an interactive workspace active, expose file browsing and
edits through a server-side proxy, run selected commands, call OpenCode or the
OpenAI direct fallback, push a branch, and open a draft PR.
- Browser agent workspace at `/spoons/[spoonId]/agent/[jobId]` with persisted
thread messages, file tree, Monaco editor with optional Vim mode, diff view,
command panel, and draft PR actions.
- Password auth and Authentik OAuth through Convex Auth.
- Expo companion app shell with password and Authentik sign-in.
- Self-hosted local Convex using Postgres storage.
Not implemented yet:
- Browser IDE/editor.
- Automatic merge.
- Additional Git provider automation beyond preserving provider-neutral fields.
- Additional remotes as push targets.
- Long-running service-stack orchestration inside agent jobs.
- Direct browser access to agent containers.
- Production mobile build/release setup.
## Architecture
@@ -61,6 +65,8 @@ The core domain objects are:
- `syncRuns`: future upstream checks, merge attempts, and AI reviews.
- `agentRequests`: prompt-driven agent work requests.
- `agentJobs`: worker-executed coding-agent jobs and their PR lifecycle.
- `agentJobMessages`: persisted per-job agent workspace thread messages.
- `agentWorkspaceChanges`: recorded user, agent, and command workspace changes.
- `spoonSecrets`: encrypted per-Spoon environment variables.
- `spoonAgentSettings`: per-Spoon agent model, branch, and command settings.
@@ -112,6 +118,10 @@ Run the optional local agent worker in a separate terminal:
bun dev:agent
```
The worker also starts an internal HTTP API, defaulting to
`http://localhost:3921`, for server-side Next route handlers. The browser never
receives the worker token or talks to this API directly.
The Docker Compose local worker service is disabled by default behind the
`agent` profile. Build the job image before using Docker-backed jobs:
@@ -120,6 +130,9 @@ docker build -f docker/agent-job.Dockerfile -t spoon-agent-job:latest .
docker compose -f docker/compose.local.yml --profile agent up spoon-agent-worker
```
The job image includes the OpenCode CLI. Rebuild it after changes to
`docker/agent-job.Dockerfile`.
## Environment model
Local `dev` and `staging` values come from Infisical through `scripts/with-env`.
@@ -175,6 +188,9 @@ GITHUB_APP_INSTALLATION_ID
GITHUB_APP_OWNER
SPOON_ENCRYPTION_KEY
SPOON_WORKER_TOKEN
SPOON_AGENT_WORKER_INTERNAL_TOKEN
SPOON_AGENT_WORKER_HTTP_PORT
SPOON_AGENT_WORKER_URL
USESEND_API_KEY
USESEND_URL
USESEND_FROM_EMAIL