optio
CLAUDE.md1.1k starsChanged 9 months agoMITView on GitHub
Context and conventions for AI assistants working on the Optio codebase. Optio is an orchestration system for AI coding agents. Think of it as "CI/CD where the build step is an AI agent." One primary user-facing concept (Tasks) with one attribute (has a repo) flipping the pipeline, plus shared primitives: Tasks — a configured unit of agent work. A Task has a Who (agent type), What (prompt or template), When (trigger: manual / schedule / webhook / ticket), Where (optional…
- Reads credentials
- Installs packages
Trending
Quiet since April.thin dataabout the whole repository
Who's talking about jonwiggins/optio
- A Hacker News story“Show HN: Optio – Orchestrate AI coding agents in K8s to go from ticket to PR”Hacker News · Mar 25, 2026 · 88 points
- @sirile.bsky.social“The dream of ticket-to-PR automation keeps getting closer. But I wonder how this handles the messy reality …”Bluesky · Mar 26, 2026 · 1 likes
- @hnbot.gsuscs.xyz“Show HN: Optio – Orchestrate AI coding agents in K8s to go from ticket to PR …”Bluesky · Mar 25, 2026 · 1 likes
- @hackernewsbot.bsky.social“Show HN: Optio – Orchestrate AI coding agents in K8s to go from ticket to PR | Discussion”Bluesky · Mar 25, 2026 · 1 likes
- @hnws.bsky.social“Show HN: Optio – Orchestrate AI coding agents in K8s to go from ticket to PR L: …”Bluesky · Mar 25, 2026 · 1 likes
The biggest 5 of 10 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 10
Talked about on Bluesky, GitHub and Hacker News (10 times).
On Bluesky · 5
- Mar 26, 2026The dream of ticket-to-PR automation keeps getting closer. But I wonder how this handles the messy reality where most tickets are actually… — @sirile.bsky.social1 likes and repost · 1 reply
- Mar 25, 2026Show HN: Optio – Orchestrate AI coding agents in K8s to go from ticket to PR https://github.com/jonwiggins/optio — @hnbot.gsuscs.xyz1 likes and repost · 1 reply
- Mar 25, 2026Show HN: Optio – Orchestrate AI coding agents in K8s to go from ticket to PR | Discussion — @hackernewsbot.bsky.social1 likes and repost
- Mar 25, 2026Show HN: Optio – Orchestrate AI coding agents in K8s to go from ticket to PR L: https://github.com/jonwiggins/optio C:… — @hnws.bsky.social1 likes and repost · 1 reply
- Mar 25, 2026Show HN: Optio – Orchestrate AI coding agents in K8s to go from ticket to PR Discussion — @hn100.bsky.social1 likes and repost · 1 reply
On GitHub · 4
- Apr 5, 2026[scout:skip] Optio — AI 에이전트 워크플로우 오케스트레이션 (Task→PR) — baekenough/oh-my-customcode0 reactions · 1 comment
- Apr 2, 2026[failure] Show HN: Optio – Orchestrate AI coding agents in K8s to go from ticket to PR — steveash/hitchhikers-guide-to-ai-native-engineering0 reactions · 1 comment
- Mar 26, 2026📱 SNS 콘텐츠 - 2026-03-26 14:07 KST — leaf468/autothreads0 reactions
- Mar 26, 2026🤖 AI 트렌드 리포트 - 2026-03-26 14:07 KST — leaf468/autothreads0 reactions
On Hacker News · 1
- Mar 25, 2026Show HN: Optio – Orchestrate AI coding agents in K8s to go from ticket to PR88 points · 60 comments
In this repositoryOne other file it gives its agents.
- AGENTS.mdAGENTS.md
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
15 rules. About 0 are common, 2 are distinctive, and 13 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 49
Unified
/api/tasksHTTP layer: All three kinds (repo-task, repo-blueprint, standalone) are reachable through one polymorphic HTTP … - Distinctive: line 135
When a limit is hit, task is re-queued with 10s delay.
- Very specific: line 269
After changing backend code, ALWAYS rebuild + redeploy the local cluster and verify live (see the /live-e2e skill.
- Very specific: line 273
ESM everywhere: all packages use "type": "module" with .js extensions in imports (TypeScript resolves them to .ts)
- Very specific: line 278
Zustand: use useStore.getState() in callbacks/effects, not hook selectors (avoids infinite re-renders)
- Very specific: line 280
State transitions: always go through taskService.transitionTask() — validates, updates DB, records event, publishes WebSocket
- Distinctive: line 281
Secrets: never log or return secret values.
- Very specific: line 297
Pod won't start: check kubectl get pods -n optio, verify agent image exists (docker images | grep optio-agent), check …
- Very specific: line 299
Auth errors: verify CLAUDE_AUTH_MODE secret, check ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN exists, check GET /api/auth/status.
- Very specific: line 301
Tasks stuck in
queued: check concurrency limits (OPTIO_MAX_CONCURRENT, per-repo maxConcurrentTasks), look for stuck provisioning/running … - Very specific: line 303
WebSocket drops: ensure Redis is running, check REDIS_URL and INTERNAL_API_URL config.
- Very specific: line 305
Pod OOM/crash: check pod_health_events, increase resource limits.
- Very specific: line 307
OAuth login fails: verify PUBLIC_URL matches deployment URL, check provider callback URLs are registered.
- Very specific: line 319
Ensure OPTIO_AUTH_DISABLED is NOT set
- Very specific: line 320
Use managed PostgreSQL/Redis (externalDatabase.url, externalRedis.url)
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
Context and conventions for AI assistants working on the Optio codebase.
What is Optio?
Optio is an orchestration system for AI coding agents. Think of it as "CI/CD where the build step is an AI agent." One primary user-facing concept (Tasks) with one attribute (has a repo) flipping the pipeline, plus shared primitives:
Tasks — a configured unit of agent work. A Task has a Who (agent type), What (prompt or template), When (trigger: manual / schedule / webhook / ticket), Where (optional repo + branch, plus a run location: an Optio pod or a directory on the user's own machine via Optio Local), and Why (description). Tasks come in three flavors:
Repo Task —
Whereis set. The agent clones the repo into a worktree and opens a PR:- Spins up an isolated Kubernetes pod for the repository (pod-per-repo)
- Creates a git worktree for the task (multiple run concurrently per repo)
- Runs Claude Code, OpenAI Codex, GitHub Copilot, Google Gemini, OpenCode, or Cursor with the prompt
- Streams structured logs back to a web UI in real time
- Agent stops after opening a PR (no CI blocking)
- PR watcher tracks CI checks, review status, and merge state
- Auto-triggers code review agent on CI pass or PR open (if enabled)
- Auto-resumes agent when reviewer requests changes (if enabled)
- Auto-completes on merge, auto-fails on close
Supported git platforms: GitHub, GitLab (incl. self-hosted via
GITLAB_HOSTS), and AWS CodeCommit. CodeCommit auths via AWS access keys (or IRSA / instance profile when running on EKS) and uses the AWS CLI credential helper for clones; PR ops go through@aws-sdk/client-codecommit. CodeCommit has no native CI or issues —getCIChecksreturns[](auto-merge still fires onchecksStatus="none"),listIssuesreturns[], andreviewTrigger="on_pr"is recommended over the defaulton_ci_passfor CodeCommit repos.- Standalone Task — no
Where. The agent runs in an isolated pod with no repo checkout, producing logs and side effects (e.g., queries Slack, posts to a database). Scheduled/webhook-driven runs of this flavor are the common case. - Persistent Agent — long-lived, named, message-driven agent process that does not terminate after running. Halts after each turn and waits to be re-woken by a user message, an agent message, a webhook, a cron tick, or a ticket event. Addressable by other agents in the same workspace via the inter-agent HTTP API (
/api/internal/persistent-agents/*). Three configurable pod lifecycle modes:always-on,sticky(default, with idle warm window), andon-demand. UI at/agents. Schema:persistent_agents,persistent_agent_turns,persistent_agent_messages(pods inagent_pods, turn logs intask_logs). Seedocs/persistent-agents.mdand the demo inexamples/persistent-agents/forge/.
Scheduled (Task Configs) — a saved Task blueprint that spawns fresh Tasks on a trigger firing. Stored in work_definitions (kind = 'repo-blueprint'). Each firing calls instantiateTask() which goes through the full Repo Task pipeline. Managed from /work?view=recurring (detail at /tasks/scheduled/:id). Standalone equivalents (Jobs) and Local automations are the same table's other kinds (see backend-naming note below).
Triggers — polymorphic table workflow_triggers keyed by (target_type, target_id): job (Jobs), task_config (scheduled Tasks), local_blueprint (Local automations), persistent_agent, pr_review. The same seven types attach to any target: manual, schedule (cron), webhook, ticket, and the github / slack / linear events. One CRUD (services/trigger-service.ts) and one dispatcher (services/trigger-dispatch.ts, fireTrigger) serve every route and every firing path — the schedule poller, /api/hooks/:path, the ticket sweep, and the event ingress.
Templates — reusable prompt templates in prompt_templates with a kind discriminator (prompt / review / job / task). Supports {{param}} substitution and {{#if param}}...{{/if}} blocks. Rendered lazily on trigger firing so params from the trigger payload substitute into the prompt.
Connections — external service integrations injected into agent pods at runtime via MCP (Model Context Protocol). Built-in providers: Notion, GitHub, Slack, Linear, PostgreSQL, Sentry, Filesystem. Also supports custom MCP servers and HTTP APIs. Fine-grained access control (per-repo, per-agent-type, permission levels).
Backend-naming note. For historical reasons the tables are tasks (Repo Tasks' one-time runs), work_definitions (every saved, re-runnable definition: kind = repo-blueprint (scheduled Task, was task_configs) | standalone (Job, was workflows) | local-blueprint (Local automation, was local_blueprints); one CRUD in work-definition-service.ts, and the legacy services project rows back to their old API shapes), and workflow_triggers (the shared trigger surface). tasks holds every run — kind = repo (a Repo Task) | standalone (a Job run) — and code about one kind goes through a view: repo_tasks (the schema's tasks, every column of the repo runs) or workflow_runs (the schema's workflowRuns, Job runs under their old column names); workRuns is the table itself (see the Drizzle convention below). The v0.4 UI settled on these user-facing names:
- Tasks — Repo Tasks (formerly "Repo Tasks" in copy; now just "Tasks")
- Jobs — Standalone Tasks (matches the
/api/jobsURL and/jobs/*web routes) - Reviews — code-review subtasks + external PR reviews (formerly "PR Reviews"; promoted out of
/tasksinto its own top-level slot) - Issues — GitHub Issues queue (promoted to its own top-level nav item)
- Agents — Persistent Agents (the third tier; long-lived, message-driven)
- Prompts — reusable prompt templates (was "Templates" in the Library)
v0.6 — one noun: Work. The UI presents every one of these as work with five attributes — When (what starts it), Where (pod / your machine), Who (a terminal or an agent runtime + its parameters), What (the prompt), and Then (exit conditions: exits when done / waits for me / persistent agent) — plus a name. Work can be a one-time terminal on a pod or a machine, a one-off agent run, an agent handling a PR, or a recurring definition with prior runs and a history. The sidebar's top level is Overview · Work · Reviews · Inbox, then Library (Prompts · Repos · Machines · Connections); iOS has a Work tab with All / Reviews / Inbox under it. /work is the unified list (rows from GET /api/work, projected server-side in services/work-service.ts; views: Active / Recurring / Agents / History; GET /api/work/:id resolves an id of any kind); /work/new is the one creation form (components/work-form/: model.ts derives which row to create — deriveKind — from the attributes, submit.ts builds a WorkSpec — the five attributes, packages/shared/src/work/spec.ts — and POSTs it to /api/work, which derives the kind with the same rule (kindOfSpec) and writes the row and its trigger in one transaction, so a rejected trigger leaves nothing behind). Every When works with every Where: a GitHub / Slack / Linear event can start a Job or a scheduled Task in a pod as well as an automation on a machine; the form attaches the same trigger row whatever the kind. Every Who works with every When and Where it fits: a Terminal is a shell you open (a pod session; a terminal on your machine, by hand or on a trigger) or a command that runs and exits — a Job with no agent (who.runtime: null, stored agent_type null, agentRuntime: "shell" in /api/jobs), in a pod or on a machine, on any trigger, its {{param}}s passed as shell variables (renderCommandTemplate: each value is assigned single-quoted on the first line and every {{param}} only references it, so a payload is never parsed as shell code, even inside quotes) and its exit status settling the run (services/command-run.ts). A persistent agent can have a repo (one of its workspace's): its turns work in one checkout of it (/workspace/repo, cloned once, fetched each turn, following a new repo or branch — CHECKOUT_REPO in utils/pod-env.ts), signed in with a short-lived installation token rather than the credential helper (applyGitAccess(env, { helper: false }) in services/git-access-env.ts). What stays apart is what doesn't make sense: "works until merged" needs an agent and a repo, a pod session needs a repo and a person, a persistent agent lives in a pod. /tasks/new, /jobs/new, /agents/new, and the v0.5 /sessions, /sessions/new, /sessions/:id/edit redirect to their /work equivalents. apps/web/e2e/work-form.spec.ts drives every kind through the form against the real API. The per-kind list pages (/tasks, /jobs, /agents, /local, /tasks/scheduled) are gone — each redirects to the matching Work view — while the per-kind detail pages (/tasks/:id, /jobs/:id, /tasks/scheduled/:id, /agents/:id, /local/:id, /sessions/:id for pod sessions) remain and link back to /work. Recurring work is edited in the same form. A Recurring row opens the page about the definition (stats, triggers, prior runs: /tasks/scheduled/:id, /jobs/:id, or /local/automations/:id for Local automations) and carries a pencil to /work/:id/edit (components/work-form/load.ts resolves the id with GET /api/work/:id and turns the stored work_definitions row back into a draft — one mapping for every kind; submit.ts's updateWork sends the spec to PATCH /api/work/:id, which keeps the kind and moves the edited trigger in the same transaction). The saved kind is locked while editing (kindLock in model.ts): answers that would move the row to another table are disabled with a reason. /jobs/:id/edit redirects there; the Machines automations list and the /tasks/scheduled/:id page link there for edits. Legacy /tasks?tab=... URLs redirect to /work?view=recurring, /issues, /reviews. "Session" keeps only its narrow meaning: an interactive pod session (/sessions/:id, interactive_sessions).
For the long-form explanation of how the two flavors map to the three internal types, the polymorphic HTTP layer, and how the UI presents them, see docs/tasks.md.
Unified /api/tasks HTTP layer. All three kinds (repo-task, repo-blueprint, standalone) are reachable through one polymorphic HTTP resource:
GET /api/tasks?type=repo-task|repo-blueprint|standalone|all— unified listPOST /api/tasks— body takes{ type, ... }; dispatches to taskService, taskConfigService, or workflowService based on typeGET /api/tasks/:id— resolves the id across all three tables; returns native row tagged withtypediscriminatorGET/POST /api/tasks/:id/runs[/:runId]— polymorphic runs (spawnedtasksfor blueprints,workflow_runsfor standalone, 405 for ad-hoc)GET/POST/PATCH/DELETE /api/tasks/:id/triggers[/:triggerId]— polymorphic triggers (405 for ad-hoc repo-task)- Resolver:
unified-task-service.resolveAnyTaskById()checks tasks → work definitions (scheduled Tasks, Jobs) → PR reviews; UUIDs are globally unique so no collision./api/work(below) is the newer resource over every kind.
Legacy /api/jobs/* and /api/task-configs/* endpoints still work as thin aliases for back-compat.
/api/work — every kind of work as one resource (routes/work.ts). GET /api/work is the Work list (rows projected server-side in services/work-service.ts); GET /api/work/:id resolves any id; POST /api/work creates from a WorkSpec (the five attributes, packages/shared/src/work/spec.ts): the server derives the kind (kindOfSpec), plans owner and pod secrets (work-ownership.ts), and writes a definition or persistent agent and its trigger in one transaction — a Job started now gets its first run (services/work-write-service.ts). PATCH /api/work/:id saves a definition (kind fixed, the edited trigger follows When), DELETE removes one, /runs lists what a definition started, /triggers manages its triggers. 409s carry details: "name_taken" | "webhook_path_taken". Every legacy endpoint keeps its exact response shape (the iOS / Android apps and the CLI call them).
Where → Environment: per-work settings over the repo's (WorkSettings, packages/shared/src/work/settings.ts; settings jsonb on tasks, work_definitions, persistent_agents). The repo's and the workspace's settings are the defaults; a piece of pod work can switch connections, MCP servers, and skills on or off by id ({ add, remove }), run its own setup commands (OPTIO_WORK_SETUP_COMMANDS, before the agent), pick its pod secrets, and — when it opens a PR — be more careful than its repo, never less: ask for a code review, open draft PRs (cautious mode), or resume fewer times (effectivePrSettings in the shared settings: the repo's settings are admin-only, so a member's work can't loosen them). Only changes are stored (cleanWorkSettings; null = follow the repo). services/agent-environment-service.ts (buildAgentEnvironment) turns defaults + settings into .mcp.json, skill files, and env for every pod worker — task, PR review, Job, persistent agent — so Jobs and agents get connections, MCP servers, and skills like Repo Tasks do (a command Job gets only its setup commands; a PR-review pod, which reads untrusted diffs, gets connections without their credentials); the one setup-file writer is WRITE_SETUP_FILES in utils/pod-env.ts (sensitive files chmod 600, everything it writes into a checkout added to .git/info/exclude), and RUN_WORK_SETUP_COMMANDS runs the MCP servers' install commands (a failure only warns) and then the work's setup commands. The reconciler's snapshot reads the PR settings over the repo's; a scheduled Task copies its settings into each task it spawns; a Job run reads its Job's. GET /api/work/environment?repoUrl=&agentType=&owner= lists what the form can toggle, defaults marked. Work on a machine takes none of it (the machine's own CLI config).
Architecture
┌─────────────┐ ┌──────────────┐ ┌─────────────────────────────┐
│ Web UI │────→│ API Server │────→│ K8s Pods │
│ Next.js │ │ Fastify │ │ │
│ :30310 │ │ :30400 │ │ ┌─ Repo Pod A ──────────┐ │
│ │←ws──│ │ │ │ clone + sleep │ │
│ Run │ │ - BullMQ │ │ │ ├─ worktree 1 │ │
│ Tasks │ │ - Drizzle │ │ │ ├─ worktree 2 │ │
│ Jobs │ │ - WebSocket │ │ │ └─ worktree N │ │
│ Reviews │ │ - PR Watcher │ │ └────────────────────────┘ │
│ Issues │ │ - Workflow Q │ │ ┌─ Job Pod ─────────────┐ │
│ Scheduled │ │ - PA Worker │ │ │ isolated agent │ │
│ Live │ │ - Reconciler │ │ └────────────────────────┘ │
│ Agents │ │ - Health Mon │ │ ┌─ Persistent Agent Pod ┐ │
│ Sessions │ │ - Connection │ │ │ long-lived; turns │ │
│ │ │ Service │ │ │ wake on messages │ │
└─────────────┘ └──────┬───────┘ │ └────────────────────────┘ │
│ └──────────────────────────────┘
┌──────┴───────┐
│ Postgres │ State, logs, workflows, persistent agents,
│ │ inboxes, connections, secrets
│ Redis │ Job queue, pub/sub
└──────────────┘
All services run in Kubernetes (including API and web). Local dev uses
Docker Desktop K8s with Helm. See setup-local.sh.Pod-per-repo with worktrees
Central optimization. Instead of one pod per task (slow, wasteful), one long-lived pod per repository:
- Pod clones repo once, runs
sleep infinity. Tasksexecin:git worktree add→ run agent → cleanup - Multiple tasks run concurrently per pod (one per worktree)
- Pods use persistent volumes; idle for 10 min (
OPTIO_REPO_POD_IDLE_MS) before cleanup - Entrypoints:
scripts/repo-init.sh(pod),scripts/agent-entrypoint.sh(legacy)
Multi-pod scaling: repos can have multiple pod instances for higher throughput.
maxPodInstances(default 1, max 20) — pod replicas per repomaxAgentsPerPod(default 2, max 50) — concurrent agents per pod- Total capacity =
maxPodInstances × maxAgentsPerPod - Pod scheduling: same-pod retry affinity → least-loaded → dynamic scale-up → queue overflow
- LIFO scaling: higher-index pods removed first on idle cleanup
Worktree lifecycle
Tasks track worktree state via tasks.worktreeState: active, dirty, reset, preserved, removed. tasks.lastPodId enables same-pod retry affinity. See repo-cleanup-worker for cleanup rules.
Task lifecycle (state machine)
pending → queued → provisioning → running → pr_opened → completed
↓ ↑ ↓ ↑
needs_attention needs_attention
↓ ↓
cancelled cancelled
running → failed → queued (retry)State machine in packages/shared/src/utils/state-machine.ts. All transitions validated — invalid ones throw InvalidTransitionError. Always use taskService.transitionTask().
Priority queue and concurrency
Tasks have integer priority (lower = higher). Two concurrency limits:
- Global:
OPTIO_MAX_CONCURRENT(default 5) — total running/provisioning tasks - Per-repo:
repos.maxConcurrentTasks(default 2) — effective limit ismax(maxConcurrentTasks, maxPodInstances × maxAgentsPerPod)
When a limit is hit, task is re-queued with 10s delay.
Authentication
Web UI: Multi-provider OAuth (GitHub, Google, GitLab, generic OIDC). Enable by setting <PROVIDER>_OAUTH_CLIENT_ID + <PROVIDER>_OAUTH_CLIENT_SECRET (or OIDC_ISSUER_URL + OIDC_CLIENT_ID + OIDC_CLIENT_SECRET for generic OIDC) — or, for Google, in the app: Settings → Access → Sign-in stores the OAuth client (secret encrypted on the row in auth_provider_configs, precedence over env) with allowed domains (Google Workspace hd + verified email, domainDecision). Only deployment admins (users.deployment_admin, or OPTIO_DEPLOYMENT_ADMINS) may change it. A fresh install with no provider is in bootstrap mode: /login → /setup, whose first step (Sign-in) is unlocked by the one-time setup token (OPTIO_SETUP_TOKEN, else generated, shared via Redis and printed in the API log); the first person to sign in becomes the deployment admin and their workspace the organization's (completeSignIn). Code: services/sign-in-config-service.ts, routes/sign-in.ts; see docs/sign-in.md. Sessions use SHA256-hashed tokens (30-day TTL). Local dev bypass: OPTIO_AUTH_DISABLED=true.
Claude Code (four modes, selected in setup wizard):
- API Key:
ANTHROPIC_API_KEYenv var injected into agent pods - OAuth Token (recommended for k8s):
CLAUDE_CODE_OAUTH_TOKENencrypted secret injected into pods - Vertex AI (GCP workloads): Routes through Google Cloud Vertex AI. Uses
CLAUDE_VERTEX_PROJECT_ID,CLAUDE_VERTEX_REGION, and optionalCLAUDE_VERTEX_SERVICE_ACCOUNT_KEY(encrypted, global scope). Falls back to workload identity when no service account key provided. Service account keys written to/home/agent/.config/gcloud/gsa-key.jsonwith chmod 600 - Max Subscription (legacy, local dev only): reads from host macOS Keychain
Key subsystems
These are well-documented in code; read the relevant service files for details:
- PR watcher (
pr-watcher-worker.ts): polls PRs every 30s, tracks CI/review, triggers reviews, auto-resumes, handles merge/close - Code review agent (
review-service.ts): launches review as blocking subtask, usesrepos.reviewModel(defaults to sonnet) - Subtask system: three types (child, step, review) via
parentTaskId, withblocksParentfor synchronization - Prompt templates:
{{VARIABLE}}+{{#if VAR}}...{{/if}}syntax. Priority: repo override → global default → hardcoded fallback - Shared cache directories: per-repo persistent PVCs for tool caches (npm, pip, cargo, etc.), managed via
/api/repos/:id/shared-directories - Interactive sessions: persistent workspaces with terminal + agent chat, at
/sessions - Workspaces: multi-tenancy via
workspaceIdcolumn. Roles (admin/member/viewer) enforced API-wide: a default-deny baseline inplugins/auth.tsmakes viewers read-only on all mutating/apiroutes (self-scoped allowlist: logout, own PATs, workspace create/switch, notification prefs, own comments, ending own sessions);requireRole("member"|"admin")preHandlers gate routes explicitly (admin: repos, secrets, cluster, connections, MCP servers, ticket providers, shared directories, Optio settings, auth refresh, claude-token proxy); mutating WebSockets (session terminal/chat, Optio chat) enforcerequireWsRoleinws/ws-authz.ts - Standalone Tasks / Jobs (
workflow-service.ts,workflow-worker.ts): listed in/work?view=recurring(detail at/jobs/:id, runs at/jobs/:id/runs/:runId). Agent runs (or shell commands, with no agent) with no repo,{{PARAM}}prompt templates, every trigger type, pooled pod execution, real-time log streaming, auto-retry with exponential backoff. Pods are shared across runs within a workflow, keyed on(workflow_id, instance_index)(agent_podsrows withpool = 'standalone'): each Job hasmaxPodInstancespod replicas (default 1, max 20) andmaxAgentsPerPodconcurrent runs per pod (default 2, max 50) — mirrors repo pod scaling. Runs track their assigned pod viaworkflow_runs.pod_idand remember it for retry affinity vialast_pod_id. Schema:work_definitions(kind = 'standalone'),workflow_triggers,tasksrows withkind = 'standalone'(read and written through theworkflow_runsview), logs intask_logs,agent_pods - Repo Task Configs (
task-config-service.ts, routes intask-configs.ts): reusable Repo Task blueprints that spawn tasks when triggers fire.instantiateTask(configId, { triggerId, params })creates a task with rendered prompt + title, transitions it to QUEUED, and enqueues the BullMQ job. UI at/work?view=recurring+/tasks/scheduled/:id. Schema:work_definitions(kind = 'repo-blueprint'); a spawned task points back withtasks.work_id - Triggers (
trigger-service.ts,trigger-dispatch.ts,event-trigger-service.ts,workflow-trigger-worker.ts, shared bodies inschemas/trigger.ts): polymorphic trigger table (workflow_triggers) keyed by(target_type, target_id).trigger-serviceis the one CRUD every route uses (listTriggers/createTrigger/updateTrigger/deleteTrigger,validateTriggerConfig, webhook-path uniqueness, schedulenext_fire_at);TRIGGER_TYPES_FOR_TARGETin@optio/sharedsays which types a target takes (all seven forjob/task_config/local_blueprint/persistent_agent,scheduleonly forpr_review).trigger-dispatch.fireTrigger(trigger, firing)starts what the target starts (createWorkflowRun/instantiateTask/spawnFromBlueprint/wakeAgent/reReview) and stampslast_fired_at; the schedule worker (polls every 60s,OPTIO_WORKFLOW_TRIGGER_INTERVAL), the webhook ingress,fireTicketTriggers(ticket sweep), andfireEventTriggers(GitHub / Slack / Linear ingress; matching inevent-trigger-service.ts) all go through it. A scheduled Task with agithubtrigger and noreposfilter listens to its own repo; a task started by a PR / issue event is not ticket-linked (that would auto-close the issue). - Prompts / Templates (
prompt-template-service.ts, routes inprompt-templates.ts): reusable prompt templates withkinddiscriminator (prompt/review/job/task).renderTemplateString(template, params)handles{{param}}substitution +{{#if}}blocks. UI at/templates(labeled Prompts in the Library nav as of v0.4 — the "Templates" name was freed for other use). - Persistent Agents (
persistent-agent-service.ts, workerspersistent-agent-worker.ts/persistent-agent-cleanup-worker.ts, routes inpersistent-agents.tsandpersistent-agent-internal.ts): the third Task tier — long-lived, named, message-driven. Cyclic state machine (idle → queued → provisioning → running → idle), per-agent pod lifecycle modes (always-on/sticky/on-demand). Wake sources: user/agent messages, webhook, cron tick, ticket event, system. Inter-agent HTTP API at/api/internal/persistent-agents/*(auth viaX-Optio-Agent-Token). UI at/agents(under "Live"). Schema:persistent_agents,persistent_agent_turns,persistent_agent_messages(pods inagent_pods, turn logs intask_logs). Seedocs/persistent-agents.mdand the demo inexamples/persistent-agents/forge/. - Agent pods (
agent-pod-pool.ts, tableagent_pods): every pod Optio runs agents in — a repo's pods, a Job's pooled pods, a persistent agent's pod — is one row keyed by(pool, pool_key, instance_index)(pool=repo/standalone/persistent-agent;pool_key= the normalized repo URL / the Job's id / the agent's id).pickPodis the one selection (retry affinity → least-loaded → reap dead / errored / stuck rows → scale out at the lowest free index), plus slots (acquireSlot/releaseSlot) and count repair;repo-pool-service(StatefulSets, PVCs, sidecars),workflow-pool-service(Jobs), andpersistent-agent-pool-service(warm windows) keep only what is theirs. The cluster API still serves repo pods in their old shape (repoPodView) - Run logs and spend (
run-log-service.ts,run-usage.ts):task_logsis the one log table for every run (Repo Tasks and Job runs), PR-review runs, and persistent-agent turns. Spend is added in SQL (addUsage/plusCost, exactnumeric, atomic), so a retried or resumed run sums its attempts - Connections (
connection-service.ts): external service integrations via MCP. Built-in providers: Notion, GitHub, Slack, Linear, PostgreSQL, Sentry, Filesystem. Also supports custom MCP servers and HTTP APIs. Three-layer model: providers (catalog) → connections (configured instances) → assignments (per-repo/agent-type rules). Injected into every agent pod (Repo Tasks, reviews, Jobs, persistent agents) byagent-environment-service.buildAgentEnvironment, with the work's ownsettings.connectionsadded or left out - Reconciliation control plane (
workers/reconcile-worker.ts,services/reconcile-{snapshot,executor,queue}.ts,packages/shared/src/reconcile/): K8s-style reconciler with fourRunKinds —repo(Repo Task runs intasks),standalone(Job runs:tasksrows withkind = 'standalone', through theworkflow_runsview),pr-review(external PR reviews), andpersistent-agent(Persistent Agents inpersistent_agents). Pure decision functions consume a frozenWorldSnapshotand return a typedAction; the executor applies it under CAS so concurrent passes can't trample each other. Producers —taskService.transitionTask,workflow-service'stransitionWorkflowRunCas,pr-watcherpoll cycle,repo-cleanuppod-health detection,wakeAgent()(PA inbox + trigger dispatch) — wake the reconciler viaenqueueReconcile. Periodic resync (OPTIO_RECONCILE_RESYNC_INTERVAL, 5 min) catches anything missed. The reconciler owns: PR-driven transitions (auto-merge, complete-on-merge, fail-on-close), auto-resume on CI/conflict/review (capped byOPTIO_MAX_AUTO_RESUMES), review launch, stall + pod-death detection, control-intent (cancel/retry/resume/restart), and the Persistent Agent turn cycle. Schema:control_intent,reconcile_backoff_until,reconcile_attemptscolumns ontasks(every run) andpersistent_agents. Seedocs/reconciliation.md - Optio Local (
local-host-service.ts,local-terminal-service.ts,local-blueprint-service.ts,local-relay.ts, ws inws/local-daemon.ts+ws/local-terminal-stream.ts, routes inroutes/local.ts, daemon inapps/cli/src/local/): terminals on the user's own machine, managed from the web UI at/local. The CLI daemon (optio local up) makes one outbound WS to/ws/local/daemon(PAT auth), advertises a dir allowlist (kept in the machine'slocal.json; the Machines page and the New work form add / remove dirs through the daemon — adirsframe,local-dirs-service.ts— unless it runs with--no-remote-dirs), and runs node-pty PTYs; the in-process relay (local-relay.ts, single API replica) routes frames to browser viewers on/ws/local/terminals/:id/stream(binary = terminal bytes, JSON = control); which viewer's screen the PTY is sized for is decided there too (local-grid.ts: the screen in use, from the viewers'viewreports). Attention detection is daemon-side and layered: Claude Code hooks (Stop/Notification/UserPromptSubmit via a localhost hook server) → OSC-aware bell scanner → silence heuristic; persisted asattention_state(working/needs_you/idle) driving the cockpit's "needs you" queue. Local Automations (work_definitionsrows withkind = 'local-blueprint', "blueprints" in code) are agent / terminal specs spawned byworkflow_triggerswithtarget_type="local_blueprint": any of the seven trigger types incl. the eventsgithub/slack/linear(signed ingress inroutes/event-ingress.ts+ the existing GitHub receiver; matching inevent-trigger-service.ts, the same path that fires pod-side Jobs and scheduled Tasks).sessionModepicksinteractive(agent halts at its prompt for chat) orheadless(claude -petc., exits when done); the daemon reports the agent'ssession_idso an exited run can be resumed (POST /api/local/terminals/:id/resume). Trigger params reach a command throughrenderCommandTemplate(shell variables, never spliced in) — payloads can never inject commands. Hosts are per-user (never workspace compute); local agents use the machine's own CLI auth (no server secrets ship to laptops). The daemon launches Claude Code with--permission-mode autounless the spawn'spermissionModesays otherwise (a headlessclaude -pwould otherwise deny everything that needs approval), passeseffort, and reports the models its Codex offers (codex debug models, anagent-modelsframe, merged intoGET /api/agents/openai/options); seecli/src/local/agent-command.tsandcli-probes.ts. Local runs (local-run-service.ts): every Task, Job, and scheduled-Task blueprint has a run location (run_target=cluster|local, pluslocal_host_id/local_dir/local_session_mode) picked with the sharedcomponents/run-location-picker.tsx; the task / workflow workers dispatchlocalruns to the daemon as an agent terminal (spawned_by = "job" | "task",local_terminal_idon the run) instead of a pod, and the terminal's frames drive the run's state (syncLinkedRun: running, usage → cost, PR link →pr_opened, exit → completed / failed). The reconciler skips capacity / stall / pod checks for local runs. Schema:local_hosts,local_terminals,work_definitions. Seedocs/optio-local.md - Organization and private scope (
services/ownership.ts; the work-specific rules inwork-ownership.ts): every scoped resource — secrets, connections, model providers, MCP servers, skills, prompts, and work of every kind — is the organization's (owner_user_idnull; everyone in the workspace sees it) or one person's private one (visible to its owner alone, read-only to workspace admins, who see it named with its owner and may delete it; changing / running / using it is a 403 for everyone else, admins included).visibleOwneris the SQL term every list uses,canSee/canChangethe row forms,usableBywhat a piece of work may be given (the organization's rows plus its owner's own). A member fetching someone else's private row gets a 404. Private work is hidden from other members everywhere (Work list, per-kind lists and details, recent runs, the events socket); a private agent is addressable only by its owner's agents. Private secrets (scope = "user") are stored without a workspace (a boot-time heal re-binds older rows). UI vocabulary is fixed: pickers Organization / Private, sections Organization / Private / Other people's, chip Private (lib/owner.ts,hooks/use-current-user.ts,components/ui/{owner-segments,scoped-list,owner-picker,owner-chip}.tsx; the Secrets page is the exemplar). Seedocs/scope.md - Config as code (
services/config/,routes/config.ts,workers/config-sync-worker.ts, schemas inschemas/config.ts, shared types inpackages/shared/src/config/): every Job, scheduled Task, persistent agent, prompt, repo, MCP server, skill and connection can be a YAML manifest (apiVersion: optio/v1,kind,metadata.name= identity,spec; references by name, secrets by name or${{SECRET_NAME}}, never values). A cluster mounts a directory of them (OPTIO_CONFIG_DIR; HelmconfigAsCode.*) that the sync worker reads everyOPTIO_CONFIG_INTERVALand applies to one workspace (OPTIO_CONFIG_WORKSPACEslug, default the oldest): create / adopt / update (a managed row edited in the UI is put back and reported as reverted) / replace / prune (OPTIO_CONFIG_PRUNE, default on), each manifest its own error. One handler per kind inservices/config/kinds/*.ts(desire / find / diff / create / update / remove / export); the engine isapply.ts. Managed rows carrymanagedBy(withManagedBy/withManagedWork, nothing is managed unlessOPTIO_CONFIG_DIRis set) and show a Managed chip and banner; Detach stops it.GET /api/config/schema.json(public) is the JSON Schema;GET /api/config/export[.yaml]exports;POST /api/config/applyis whatoptio apply -fposts (a plain upsert: manages nothing, never prunes);optio export -o DIRwrites one file per resource. Settings → Config as code shows the directory's last sync. Seedocs/config-as-code.md - Model providers, owners, pod secrets (
model-provider-service.ts,work-ownership.ts, routes inmodel-providers.ts,bedrockRuntimein@optio/shared): Settings → Model providers saves Amazon Bedrock for Claude Code / Codex (region, per-agent model ids, a machine AWS profile, encrypted pod credentials or the pod's IAM role); work picks one withagentOptions.modelProvider. Providers, secrets, connections and work have an owner — the organization (owner_user_idnull) or one person: private work runs with its owner's secrets / providers / connections and only its owner changes or runs it; organization work only uses organization resources.podSecretsis the list of secrets a piece of work gives its pod (GET /api/secrets/pickable). Workspaces can auto-join people by verified email domain. Seedocs/model-providers.md - Task dependencies:
task_dependenciestable for multi-step pipelines - Cost tracking:
GET /api/analytics/costswith daily/repo/type breakdowns, UI at/costs - Error classification:
packages/shared/src/error-classifier.tspattern-matches errors into categories with remedies
iOS app
Native SwiftUI client at apps/ios/ (see apps/ios/README.md). Models are generated from packages/shared/src/types by pnpm gen:swift into apps/ios/Optio/Generated/SharedTypes.swift; CI fails if that file is stale. Auth is a PAT over HTTP bearer + WebSocket subprotocol, same as the CLI. Build with cd apps/ios && make build (needs Xcode + brew install xcodegen).
Android app
Native Kotlin + Jetpack Compose (Material 3) client at apps/android/, at parity with the iOS app, whose Swift source is its spec (see apps/android/README.md; the dev lab is in apps/android/e2e/README.md). Models are generated from packages/shared/src/types by pnpm gen:kotlin into apps/android/core/model/src/main/kotlin/dev/optio/core/model/SharedTypes.kt: never hand-edit it; CI "Kotlin Types In Sync" (scripts/check-kotlin-types.sh) fails if it is stale. Auth is the same PAT as iOS and the CLI.
- Build/test from
apps/androidwithJAVA_HOMEset to Android Studio's JBR (/Applications/Android Studio.app/Contents/jbr/Contents/Home; any JDK 17–25 works):./gradlew assembleDebug,./gradlew testDebugUnitTest :core:model:test :core:network:test(the two plain-JVM modules usetest),./gradlew :<module>:recordRoborazziDebugfor screenshots (<module>/build/outputs/roborazzi/). Live tests skip unlessOPTIO_TEST_API_URLpoints at a test API. Never run./gradlew --stop(it kills every Gradle daemon on the machine). - Modules:
:app→:feature:*→:core:*(model,network,data,navigation,ui,terminal,testing,workfeed,glance). Features never depend on another feature: they push route keys from:core:navigation. Convention plugins inbuild-logic/, versions ingradle/libs.versions.toml. - Dev lab (
apps/android/scripts/):test-api.sh(hermetic API with the fake runtime and seeded data: shared 4961,--auth4980, private 4962–4979),emu.sh(headless read-only emulators on even console ports 5554–5680; exits 75 whenOPTIO_EMU_MAX, default 3, are running),test-daemon.sh(isolated Optio Local daemon). Never use 30400/30310 (the real Optio) or 4931/3131 (web e2e). Install withadb install -r -g: Android 17 needsACCESS_LOCAL_NETWORKto reach10.0.2.2or LAN hosts, or requests silently time out. - Push: FCM is optional. A Firebase
google-services.jsoninapps/android/app/(git-ignored) makes the build apply the google-services plugin; without it the app uses its on-device baseline (WorkManager check, "Keep watching"). Server side:docs/android-push.md. - CI: job "Android (build + unit tests)" runs
./gradlew assembleDebug testDebugUnitTest :core:model:test :core:network:teston Temurin 21.
Tech Stack
| Layer | Technology | Notes |
| Monorepo | Turborepo + pnpm 10 | 6 packages, workspace protocol |
| API | Fastify 5 | Plugins, schema validation, WebSocket |
| ORM | Drizzle | PostgreSQL, migrations in apps/api/src/db/migrations/ |
| Queue | BullMQ + Redis | Also used for pub/sub (log streaming to WebSocket clients) |
| Web | Next.js 15 App Router | Tailwind CSS v4, Zustand, Lucide icons, sonner toasts, Recharts |
| K8s client | @kubernetes/client-node | Pod lifecycle, exec, log streaming, metrics |
| Validation | Zod | API request schemas |
| Testing | Vitest | Test files across shared + api |
| CI | GitHub Actions | Format, typecheck, test, build-web, build-image |
| Deploy | Helm | Chart at helm/optio/, local dev via setup-local.sh |
| Hooks | Husky + lint-staged + commitlint | Pre-commit: lint-staged + format + typecheck. Commit-msg: conventional commits |
Commands
# Setup (first time — builds everything, deploys to local k8s via Helm)
./scripts/setup-local.sh
# Update (pull + rebuild + redeploy)
./scripts/update-local.sh
# Manual rebuild + redeploy
docker build -t optio-api:latest -f Dockerfile.api .
docker build -t optio-web:latest -f Dockerfile.web .
kubectl rollout restart deployment/optio-api -n optio # API + web share one pod
# Quality (these are what CI runs, and pre-commit hooks mirror them)
pnpm format:check # Check formatting (Prettier)
pnpm turbo typecheck # Typecheck all 6 packages
pnpm turbo test # Run unit tests (Vitest, all mocked, no infra)
cd apps/web && npx next build # Verify production build
# Deeper test tiers (see "Testing" section below)
pnpm --filter @optio/api test:integration # Real Postgres+Redis service tests
pnpm --filter @optio/api test:e2e # Full pipeline e2e (real server, fake pods)
pnpm --filter @optio/web test:e2e # Playwright browser e2e (seeded stack)
bash scripts/smoke-e2e.sh # LIVE cluster smoke incl. one real LLM run
# Database
cd apps/api && npx drizzle-kit generate # Generate migration after schema change
cd apps/api && npx tsx src/db/migrate.ts # Apply migrations (standalone runner)
bash scripts/check-migration-prefixes.sh # Check for duplicate prefixes
# Agent images
./images/build.sh # Build all presets (base, node, python, go, rust, full)
# Helm
helm lint helm/optio --set encryption.key=test
helm upgrade optio helm/optio -n optio --reuse-values
# Teardown
helm uninstall optio -n optioTesting
Five tiers. The first four are deterministic (no cluster, no LLM calls, no cost) and run in CI; the live tier is local-only. A change is not done until the tiers covering it pass. Pick tiers by what you touched:
| Tier | Command | Covers | Run when you change |
| Unit | pnpm turbo test | Pure logic, routes with mocked services | Anything (always) |
| Integration | pnpm --filter @optio/api test:integration | Services against real Postgres + Redis: state machines, reconciler CAS, triggers, secrets crypto, migrations-built schema | DB schema, services, reconciler, workers' DB logic |
| Pipeline e2e | pnpm --filter @optio/api test:e2e | The real API server (all 14 workers) driven over HTTP with a fake container runtime: task/job/persistent-agent lifecycles, boot + migrations from empty DB, WS log streaming | Workers, routes, pipeline, boot, reconciler behavior |
| Web e2e | pnpm --filter @optio/web test:e2e | Playwright against next dev + real API + seeded data: every top-level page, task/job/agent flows | Web UI |
| Live | /live-e2e skill → bash scripts/smoke-e2e.sh | Real K8s pods + real agent auth + one real LLM run (~$0.01) | Pod lifecycle, images, Helm, agent adapters — final check; local only, never CI |
Mechanics (integration + e2e tiers):
- Throwaway infra containers (
optio-test-postgres:54329,optio-test-redis:63790) auto-start viascripts/test-infra.sh— needs Docker running.stopto clean up. - Each test FILE gets a private database cloned from a migrated template plus a leased Redis logical DB — concurrent runs are safe. GlobalSetup sweeps leftovers from crashed runs.
- Integration tests: name
*.int.test.tsunderapps/api/src/, exemplarapps/api/src/db/harness.int.test.ts, row factories inapps/api/src/test-utils/integration/fixtures.ts. Import services normally — env already points at the private DB. - Pipeline e2e tests:
apps/api/e2e/*.e2e.test.ts, exemplarstandalone-job.e2e.test.ts;startApiServer()fromsrc/test-utils/e2e/api-server.tsspawns the real server (OPTIO_RUNTIME=fake,OPTIO_STATEFULSET_ENABLED=false, auth disabled). - The fake runtime (
packages/container-runtime/src/fake.ts) plays agents by speaking claude stream-json; script it with prompt directives:[[mock:pr]](emit PR URL → pr_opened),[[mock:fail]],[[mock:silent]](no output),[[mock:sleep:MS]],[[mock:hang]],[[mock:cost:X]]. Default = success, cost 0.0123. Repo tasks needANTHROPIC_API_KEY+GITHUB_TOKENsecrets seeded (dummy values fine) or provisioning retries forever. - Playwright: specs in
apps/web/e2e/*.spec.ts;e2e/launch-stack.tsboots API +next dev(ports 4931/3131) and seeds a repo, tasks, a job run, a template, and an agent. First run:cd apps/web && npx playwright install chromium.
After changing backend code, ALWAYS rebuild + redeploy the local cluster and verify live (see the /live-e2e skill; per standing user preference, deploy after backend changes).
Conventions
- ESM everywhere: all packages use
"type": "module"with.jsextensions in imports (TypeScript resolves them to.ts) - Conventional commits: enforced by commitlint (e.g.,
feat:,fix:,refactor:) - Pre-commit hooks: lint-staged (eslint + prettier), then
pnpm format:checkandpnpm turbo typecheck - Tailwind CSS v4:
@import "tailwindcss"+@themeblock in CSS, notailwind.configfile - Drizzle ORM: schema in
apps/api/src/db/schema.ts, rundrizzle-kit generateafter changes. New migrations use unix-timestamp prefixes (migrations.prefix: "unix"indrizzle.config.ts). Existing00xx_*files are frozen — never rename them. Migrations are hand-written SQL (the drizzle-kit snapshots stopped at0012). Run columns: add them totasksas always (ALTER TABLE "tasks" ...) and torunColumns()inschema.ts(the tableworkRunsand the viewtasks=repo_tasksboth use it);migrate-safe.tsdrops the run views before every migration and remakes them after (db/run-views.ts), sorepo_taskspicks the column up by itself. A column Job runs need goes inworkflow_runs's list inrun-views.tstoo, and inworkflowRunsin the schema - Zustand: use
useStore.getState()in callbacks/effects, not hook selectors (avoids infinite re-renders) - Next.js webpack:
extensionAliasinnext.config.tsresolves.js→.tsfor workspace packages - State transitions: always go through
taskService.transitionTask()— validates, updates DB, records event, publishes WebSocket - Secrets: never log or return secret values. Encrypted at rest with AES-256-GCM
- Cost tracking: stored as string (
costUsd) to avoid float precision issues - K8s RBAC: namespace-scoped Role (pods, exec, secrets, PVCs) + ClusterRole (nodes, namespaces, metrics)
Helm Chart
Key values.yaml settings:
- Image defaults point to GHCR (
ghcr.io/jonwiggins/optio-*). Setagent.image.prefixtooptio-for local dev postgresql.enabled/redis.enabled— set tofalseand useexternalDatabase.url/externalRedis.urlfor managed servicesencryption.key— required, generate withopenssl rand -hex 32serviceAccount.name/serviceAccount.annotations— used by API/web pods (K8s API access) and agent pods (workload identity). Example for GKE:iam.gke.io/gcp-service-account: optio@PROJECT_ID.iam.gserviceaccount.com- Local dev overrides in
helm/optio/values.local.yaml(setup-local.shapplies automatically)
Troubleshooting
Pod won't start: check kubectl get pods -n optio, verify agent image exists (docker images | grep optio-agent), check OPTIO_IMAGE_PULL_POLICY=Never for local images.
Auth errors: verify CLAUDE_AUTH_MODE secret, check ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN exists, check GET /api/auth/status.
Tasks stuck in queued: check concurrency limits (OPTIO_MAX_CONCURRENT, per-repo maxConcurrentTasks), look for stuck provisioning/running tasks.
WebSocket drops: ensure Redis is running, check REDIS_URL and INTERNAL_API_URL config.
Pod OOM/crash: check pod_health_events, increase resource limits. Cleanup worker auto-detects and fails associated tasks.
OAuth login fails: verify PUBLIC_URL matches deployment URL, check provider callback URLs are registered.
Migration errors: migrations auto-run on startup. Historical duplicate prefixes (0016, 0018, 0019, 0026, 0039, 0042) are allowlisted. New migrations use unix-timestamp prefixes.
Repo init timeout: large repos may exceed 120s default. Increase OPTIO_REPO_INIT_TIMEOUT_MS.
429 Too Many Requests in the UI / iOS / Android app: the API has a per-IP global limiter (OPTIO_RATE_LIMIT_MAX, default 600/min; auth routes have their own stricter limits). The web proxies through the Next server, but the iOS and Android apps talk to the API directly and poll several endpoints, so a low limit shows up there first.
Production Deployment Checklist
- Generate encryption key:
openssl rand -hex 32 - Configure an OAuth provider (
*_CLIENT_ID+*_CLIENT_SECRET), or leave none and configure the organization's Google sign-in from the setup wizard's Sign-in step (setup token from the API log;docs/sign-in.md) - Ensure
OPTIO_AUTH_DISABLEDis NOT set - Use managed PostgreSQL/Redis (
externalDatabase.url,externalRedis.url) - Set
PUBLIC_URLto actual deployment URL - Enable ingress with TLS
- Set
GITHUB_TOKENsecret for PR watching, issue sync, repo detection - Install
metrics-serverin cluster - Optional: keep the workspace's Jobs, agents, prompts, repos and integrations in a repo as manifests and mount them (
configAsCode.*;docs/config-as-code.md)
Known Issues
- API container runs via
tsxrather than compiled JS (workspace packages export./src/index.ts) - OAuth tokens from
claude setup-tokenhave limited scopes vs Keychain-extracted tokens
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

