跪拜 Guibai
← All articles
Backend · Agent

OMA: An Open-Source Managed Agent Platform That Decouples Brain, Sandbox, and State

By 挖坑的张师傅 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Teams can now run long-lived, stateful AI tasks on their own infrastructure with managed-agent abstractions taken from Anthropic's design, without locking business logic to a vendor's cloud. The separation of brain, sandbox, and state is a concrete pattern for building reliable, auditable agent pipelines that survive crashes and enforce credential boundaries.

Summary

OMA (open-managed-agents) is a self-hosted managed-agent platform that takes over the operational side of running AI agents in production. It centralizes the recurring problems that appear once models and tools are wired up: resuming long tasks after interruptions, keeping credentials out of generated code, persisting files, reaching internal tools, and tracing execution and cost. Business teams define an Agent's role, skills, and tools via API, then submit tasks and receive events, while the platform handles the runtime.

The architecture splits three concerns. The Platform manages sessions, permissions, and resources; the Brain (built on DeepSeek Harness) runs the agent loop outside the sandbox; and the Sandbox (Tencent's CubeSandbox in the cloud, an E2B-compatible local gateway for development) only executes commands. This decoupling means the first response doesn't wait for sandbox startup, and a sandbox crash doesn't kill in-flight reasoning. Session state, events, and files live independently so they can be rebuilt after failures. Credentials are injected by platform-side proxies and never enter the sandbox, while a FUSE-based virtual filesystem gives each session a task-ordered view without exposing the physical object storage.

For private network tools, OMA uses a reverse-connection tunnel based on OpenAI's tunnel-client, letting a cloud agent call MCP servers behind a firewall with nothing but outbound HTTPS. Observability records model and tool calls on a timeline, plus aggregated requests, tokens, costs, and failures. The project is a heavy backend infrastructure effort, and the team plans to add agent evaluation based on actual task outputs.

Takeaways
— OMA uses Anthropic's managed-agent resource model: Agent, Environment, Session, and Events, with an API compatible with the Anthropic SDK.
— The platform separates reasoning (Brain) from execution (Sandbox); the Brain runs outside the sandbox and only issues tool calls, while the Sandbox executes them in a Rust MCP server.
— This separation yields a p50 TTFT improvement of roughly 60% and a p95 improvement over 90%, according to Anthropic's managed-agents report, because first response doesn't wait for sandbox startup.
— Session state, events, and files are stored independently in PostgreSQL, NATS, and S3, so a failed sandbox can be recreated and the Brain can resume from session ID.
— OMA uses CCRv2, a non-public Claude protocol, to coordinate remote execution, covering redelivery, process recovery, instance takeover, and approvals; received/processing/processed states prevent confusing delivery with completion.
— Credentials are kept in the platform control plane: the sandbox holds only session identity, and proxies inject real credentials when calling upstream; Vault and KMS protect ciphertext and decryption separately.
— A FUSE-based virtual filesystem lets each session mount task-specific paths (e.g., /mnt/session/uploads/reports/input.csv) that don't correspond to physical object storage keys, with read-only controls for skills and writable outputs.
— Private-network MCP servers are exposed through a reverse tunnel using OpenAI's tunnel-client; the management API matches Claude Managed Agents' Tunnels interface, and only outbound HTTPS is required.
Conclusions

Choosing a non-public protocol like CCRv2 over a standard reveals a gap in the ecosystem: no common wire-level contract for agent runtime coordination, so platforms end up binding to a single vendor's protocol and betting on its stability.

The decision to mark executed-but-unlogged tool calls as unknown result and block instead of replaying is the right trade-off for side-effectful operations, but it sets a high bar for idempotency that business logic must meet.

FUSE-as-virtualization turns the filesystem into a product surface: per-session directory trees, read-only skills, writable outputs, and stable paths across sandbox replacements. That is a pattern worth copying for any multi-tenant agent platform, especially when skills are distributed as ZIPs.

Using OpenAI's tunnel-client while aligning with Anthropic's Tunnels API shows how protocol compatibility lets a project mix components from competing vendors, but the same compat layer adds integration and upgrade burden.

Concepts & terms
Managed Agents
A platform service that runs the agent loop (model calls, tool execution, and state management) on behalf of an application, exposing a higher-level API and handling production concerns like persistence, credentials, and observability.
TTFT (Time to First Token)
The latency between a user's request and the first token of the model's response; used here as a metric for how quickly an agent starts producing output.
CCRv2
A protocol used by Claude Code for remote execution, defining how a running agent process exchanges input, output, approvals, and session state with a control plane. OMA adopts it to allow replacing the brain implementation without changing the backend.
FUSE (Filesystem in Userspace)
A Linux kernel module that lets user-space programs implement file systems. OMA uses it to mount virtual directories into agent sandboxes, where the underlying storage can be object storage, databases, or remote APIs.
MCP Tunnel
A reverse-connection mechanism for exposing MCP servers inside a private network to a cloud agent. A client inside the private network establishes an outbound HTTPS connection to the cloud, and tool calls are routed through it without opening firewall ports.
From the discussion
Featured comments
shushenghong

Regarding recovery from long-task interruptions, we added an extra rule in our local execution scenario: for short interruptions, just resume from the original session; for interruptions exceeding one hour, first ask the person who assigned the task whether to continue. The reason is that after long interruptions, the main code and requirements themselves may have changed, so directly continuing would be editing on outdated context. Would like to ask whether OMA's Session recovery has considered this 'confirm before resume' step?

See top comments, translated →
Source: juejin.cn ↗ Google Translate ↗ Backup ↗