
Overview
OpenSail is an AI-powered platform for building, running, and sharing agents, full-stack apps, scheduled jobs, webhook handlers, and MCP tools. The system is modular: the same orchestrator drives desktop, Docker, and Kubernetes modes by swapping task queue, pub/sub, database, and container backends behind protocols. This page explains how the components fit together, how data flows at runtime, and how the security model is enforced.High-level diagram
Component layers
- Frontend
- Desktop shell
- Orchestrator
- Agent runner
Deployment modes
All three are selected by
DEPLOYMENT_MODE and wired via factories in orchestrator/app/services/.
Three-tier compute model
The AI agent does not need a full Kubernetes pod every time it reads a file. OpenSail separates operations by cost:
About 99% of agent operations run on Tier 0 or Tier 1. Tier 2 is only needed when the user is actively working in the workspace or the agent needs to run the full stack.
Hibernation is volume-level: a project snapshot captures the entire btrfs subvolume, then the namespace is torn down. Restore re-hydrates from CAS and brings all containers back together.
Storage: btrfs CSI and Volume Hub
User project data lives on btrfs subvolumes managed by a two-layer system.- btrfs CSI driver
- Volume Hub
- Orchestrator client
Location:
services/btrfs-csi/.Runs as a DaemonSet. Responsibilities:- Create btrfs subvolumes (instant snapshot-clone from templates)
- FileOps gRPC for agent Tier 0 file operations
- NodeOps gRPC for template builds
- S3 sync via CAS (content-addressed storage)
- Per-node garbage collection
Agent runner integration
The orchestrator enqueues anAgentTaskPayload built from project state, chat history, git status, and TESSLATE.md. The ARQ worker picks up the task and runs the tesslate-agent loop.
1
Acquire lock
Redis-based distributed lock prevents concurrent runs on the same project.
2
Loop
Each iteration: run the agent, persist
AgentStep rows, publish events to the Redis Stream, check for a cancellation signal.3
Stream to client
The API router subscribes to the stream and forwards events over SSE or WebSocket. The client renders steps in real time.
4
Finalize
On completion: write the final Message, release the lock, optionally fire a webhook for external agent callers.
Apps subsystem
An app on OpenSail is a versioned, immutable, manifest-described bundle produced from a workspace. Models:
Services:
installer.py, publisher.py, submissions.py, yanks.py, runtime.py, stage1_scanner.py, stage2_sandbox.py. See the Publishing Apps guide.
Channels and gateway
Messaging integrations live underorchestrator/app/services/channels/ with the Gateway v2 runner at services/gateway/runner.py. Platforms: Telegram, Slack, Discord, WhatsApp, Signal, CLI. Identity pairing links platform accounts to OpenSail users. Schedules (cron + timezone) deliver agent output to any configured channel.
See Communication gateways.
Security model
Every significant action writes to the append-only
AuditLog, keyed by team and project.
Next steps
Configuration
All environment variables with defaults.
Deployment
Path-by-path production guides.
Data flow
Request lifecycle, agent execution, container lifecycle.
Container orchestration
Three-tier compute, PVC lifecycle, snapshots.