Executive Summary
Paperclip supports two fundamentally different approaches to running AI agents: native local adapters (e.g., claude_local, codex_local, gemini_local) that spawn agent processes directly on the host machine, and OpenClaw gateway adapters (openclaw_gateway) that communicate with agents through the OpenClaw WebSocket protocol.
Each approach makes distinct tradeoffs across reliability, flexibility, setup complexity, and operational cost. This paper examines both architectures in depth, drawing on source code analysis, production operational data, and the broader industry context for multi-agent orchestration.
Key finding: 100% of native local agents in our production environment are operational. 66% of OpenClaw gateway agents are currently in error state — consistent with documented WebSocket timeout issues across the OpenClaw issue tracker.
Architecture Overview
2.1 Native Local Adapters (Paperclip Agents)
Native adapters follow a direct-execution model. Paperclip spawns a child process on the host machine, pipes a prompt via stdin, and captures structured JSON output from stdout. The adapter handles:
- Process lifecycle:
runChildProcess()manages spawn, timeout, graceful shutdown, and signal handling - Environment injection:
PAPERCLIP_RUN_ID,PAPERCLIP_TASK_ID,PAPERCLIP_API_KEY, and other context variables are passed as environment variables - Session management: Sessions are tracked by session ID and working directory; sessions can be resumed across heartbeats if the cwd matches
- Skill installation: A temporary directory with symlinked skills is created per run and passed via
--add-dir - Authentication: Direct API keys (e.g.,
ANTHROPIC_API_KEYfor Claude) or subscription-based local login
| Adapter | Agent Runtime | Notes |
|---|---|---|
claude_local | Claude Code CLI | Primary adapter, most mature |
codex_local | OpenAI Codex CLI | Similar architecture to claude_local |
gemini_local | Google Gemini CLI | |
cursor_local | Cursor IDE agent | |
opencode_local | OpenCode CLI | |
pi_local | Pi agent runtime |
2.2 OpenClaw Gateway Adapter
The OpenClaw adapter follows a gateway-mediated model. Instead of spawning a local process, Paperclip connects to an OpenClaw instance over WebSocket and delegates task execution to the OpenClaw agent runtime. The flow:
- WebSocket connect: Open connection to
ws://orwss://endpoint - Challenge-response auth: Server sends
connect.challengewith a nonce; client signs it with an Ed25519 device key - Device pairing: First connection requires device approval (auto-pairing available if auth token is present)
- Session routing:
sessionKeyStrategydetermines how sessions map to tasks (issue= one session per task,run= fresh session per heartbeat,fixed= shared session) - Agent dispatch: Send
agentrequest with the wake payload (task context, Paperclip env vars as text instructions) - Wait for completion: Call
agent.waitwith timeout; stream events for assistant output, errors, and lifecycle updates - Result extraction: Parse usage metrics, runtime service reports, and summary text from the response
Comparative Analysis
3.1 Reliability
Native Local — High Reliability
- Single failure point: the AI provider API
- Process lifecycle is deterministic (spawn → run → exit)
- Timeouts are straightforward: kill the child process after
timeoutSec - Session resume works reliably when cwd is consistent
- Production native agents maintain
idleorrunningstatus consistently
OpenClaw Gateway — Lower Reliability
- Multiple failure points: WebSocket, gateway health, agent runtime, AI provider
DEFAULT_HANDSHAKE_TIMEOUT_MSof 3s is too aggressive — spurious disconnects- WebSocket connections drop during long-running tasks
- Plugin loading delays (6–7s) cause handshake failures
- Browser tool sessions enter zombie states after initial timeouts
3.2 Latency and Performance
Native Local
- Near-zero overhead: process spawn is ~100ms
- Direct stream parsing of stdout JSON
- No network intermediary between Paperclip and the AI provider
OpenClaw Gateway
- WebSocket connection setup: ~1–3 seconds (connect + challenge + auth)
- Device pairing on first connect: additional round trip
waitTimeoutMsadds a waiting layer on top of actual execution- Message serialization/deserialization overhead through the gateway protocol
3.3 Flexibility and Agent Diversity
Native Local
- Limited to agents with CLI interfaces Paperclip has adapters for
- Each new agent type requires a dedicated adapter package
- Agent must be installable on the host machine
- Tight coupling between Paperclip and the agent runtime
OpenClaw Gateway
- Can connect to any agent that OpenClaw supports (including custom)
- Single adapter handles all OpenClaw-compatible agents
- Supports remote agents — OpenClaw doesn't need to run on the same machine
- Enables heterogeneous agent teams without host-level installation
3.4 Setup and Configuration Complexity
Native Local
- Simple config:
model,cwd,timeoutSec,instructionsFilePath - Agent CLI must be installed on the host
- API keys managed as environment variables
- No external infrastructure dependencies
OpenClaw Gateway
- Complex config:
url,headers,x-openclaw-token,devicePrivateKeyPem,sessionKeyStrategy,scopes,role - Requires a running OpenClaw instance with correct port config
- Device pairing workflow: generate Ed25519 key pair, initiate pairing, approve device
- Separate auth tokens for gateway vs. Paperclip API
3.5 Security Model
Native Local
- Inherits the host's security context
- API keys in environment variables (standard pattern)
- Process isolation via OS-level mechanisms
dangerouslySkipPermissionsflag available but opt-in
OpenClaw Gateway
- Multi-layer auth: gateway token + device key + challenge-response
- Ed25519 device keys with persistent pairing
- Scope-based access control (
operator.admin,operator.pairing) - Network-level isolation possible (
wss://for encrypted transport) - More attack surface due to additional network layer
3.6 Observability and Debugging
Native Local
- Direct stdout/stderr capture from the child process
- Structured JSON stream parsing with clear error codes
- Login detection and recovery (
detectClaudeLoginRequired) - Session state is transparent (session ID + cwd)
OpenClaw Gateway
- Logs prefixed with
[openclaw-gateway]for identification - Sensitive values redacted in logs
- Multiple error codes for different failure modes
- Harder to debug: gateway logs, agent logs, and Paperclip logs are separate systems
3.7 Cost
Native Local
- AI provider API costs only
- No infrastructure overhead beyond the host machine
- Billing type detection: API key →
api, local login →subscription
OpenClaw Gateway
- AI provider costs (passed through OpenClaw)
- OpenClaw infrastructure costs (compute, memory, network)
- Usage metrics extraction from
agentMeta.usagein gateway responses - Additional operational cost of maintaining the OpenClaw instance
Session Management Deep Dive
Session management is a key differentiator between the two approaches.
Native Local Adapters
- Session identified by
sessionId+cwd - Session can be resumed if the working directory matches
- Session is cleared on certain error conditions (e.g.,
missingSession) - Stateful: agent retains context from previous heartbeats within the same session
OpenClaw Gateway — Three Session Strategies
| Strategy | Session Key | Best For |
|---|---|---|
issue (default) |
paperclip:issue:{issueId} |
Multi-heartbeat tasks where context continuity matters |
run |
paperclip:run:{runId} |
Fresh session per heartbeat; stateless tasks |
fixed |
Configured key or paperclip |
Shared across all tasks — rarely appropriate |
Idempotency key is set to runId to prevent duplicate execution across retries.
Real-World Operational Evidence
Nucleotto currently runs a mixed fleet of native and gateway agents:
| Agent | Adapter | Status | Observation |
|---|---|---|---|
| CEO | claude_local |
Running | Stable, consistent execution |
| Head of Finance | claude_local |
Idle | No errors since creation |
| Gamma (Presentations) | claude_local |
Idle | Stable |
| Darla 3.0 (Co-Founder) | openclaw_gateway |
Idle | Functional but requires careful timeout config |
| Rex (CTO) | openclaw_gateway |
Error | Gateway connection failure |
| Aria (CMO) | openclaw_gateway |
Error | Gateway connection failure |
Key finding: 100% of native local agents are operational. 66% of OpenClaw gateway agents are currently in error state. This matches the broader pattern of WebSocket timeout issues documented in the OpenClaw issue tracker (issues #47931, #50380, #51987, #45419).
Industry Context
The local-vs-gateway debate mirrors a broader industry pattern in 2026:
- Hub-and-spoke (centralized gateway) models offer strong consistency and simplified management but create potential bottlenecks
- Mesh (local execution) architectures provide resilience and fault tolerance
- The winning pattern emerging is hybrid: high-level orchestrators for strategic coordination with local execution for tactical work
- Error compounding remains a fundamental challenge: 99% per-step reliability across 10 sequential steps yields only 90.4% overall reliability. Each additional gateway layer compounds this.
Recommendations
When to Use Native Local Adapters
- Mission-critical roles (CEO, CTO, finance) where reliability is paramount
- High-frequency heartbeat agents that need fast startup and consistent execution
- Agents requiring session continuity across multiple heartbeats
- Cost-sensitive deployments where minimizing infrastructure overhead matters
- When the desired agent runtime has a CLI that Paperclip supports
When to Use OpenClaw Gateway Adapters
- Accessing agent types that Paperclip doesn't have native adapters for
- Remote agent execution where agents run on different machines
- Heterogeneous teams needing diverse agent capabilities
- When OpenClaw is already deployed and well-maintained in your infrastructure
- For non-critical, async tasks where occasional timeouts are acceptable
Operational Best Practices for OpenClaw Agents
- Increase
waitTimeoutMsfor long-running tasks (default 30s is often insufficient) - Set
timeoutSecto at least 600 for complex tasks - Always persist
devicePrivateKeyPemin adapter config to avoid repeated pairing - Use
wss://for non-loopback connections - Monitor OpenClaw gateway health independently
- Consider
sessionKeyStrategy: "issue"for multi-heartbeat tasks,"run"for stateless ones - Ensure the OpenClaw
DEFAULT_HANDSHAKE_TIMEOUT_MSis increased from 3s to at least 10s
Pricing a Web UI / Chat Interface for the Orchestrator
The natural product extension for an agent orchestration platform is a web-based command interface — a chat UI where operators can see derived actions, approve or deny agent decisions, monitor task flow, and intervene when needed.
8.1 The Product Surface
The orchestrator UI is not a chatbot. It is a control plane with a conversational interface.
| Feature Layer | What the User Sees | Value Driver |
|---|---|---|
| Chat interface | Natural language commands to agents, task creation, status queries | Accessibility — no CLI needed |
| Action feed | Real-time stream of derived actions (subtask creation, code commits, API calls) | Transparency — see what agents are doing |
| Approval gates | Approve/deny pending actions, budget overruns, hiring decisions, deployments | Governance — human stays in the loop |
| Agent dashboard | Status, heartbeat history, error rates, cost per agent | Operational awareness |
| Task board | Kanban/list view of all issues, filters by status/assignee/priority | Work management |
| Audit trail | Full history of who did what, linked to runs and comments | Compliance and accountability |
| Cost analytics | Token usage, spend by agent/task/project, budget burn rate | Financial control |
8.2 Pricing Models Evaluated
Model 1: Per-Seat Subscription (Traditional SaaS)
| Tier | Price | Includes |
|---|---|---|
| Starter | $49/mo per operator | 3 agents, 1,000 actions/mo, chat UI, basic dashboard |
| Professional | $149/mo per operator | 10 agents, 10,000 actions/mo, approval gates, audit trail |
| Enterprise | $499/mo per operator | Unlimited agents, unlimited actions, SSO, SLA, custom integrations |
Cons: Misaligned with value — a solo founder running 20 agents gets more value than a 50-person team with 2 agents. Per-seat is losing ground industry-wide.
Model 2: Usage-Based (Per-Action / Per-Agent-Hour)
| Metric | Price |
|---|---|
| Per agent-hour (active compute) | $0.50–$2.00 |
| Per approval gate triggered | $0.10 |
| Per 1,000 actions logged | $1.00 |
| Per GB of audit storage | $0.50/mo |
Cons: Unpredictable bills create buyer anxiety. Hard to budget. Requires metering infrastructure.
Model 3: Outcome-Based (Per-Task-Completed)
| Outcome | Price |
|---|---|
| Per task completed (status → done) | $0.50–$5.00 depending on complexity |
| Per approval resolved | $0.25 |
| Per successful deployment | $2.00–$10.00 |
Gartner projects 40% of enterprise SaaS contracts will include outcome-based components by 2026. Already proven by Intercom ($0.99/resolved ticket) and Salesforce (per-completed-action pricing).
Model 4: Hybrid (Recommended)
A platform fee plus usage-based components, with outcome bonuses — this is the recommended model for Paperclip.
| Component | Structure |
|---|---|
| Platform fee | $99–$299/mo — covers the UI, dashboard, audit trail, up to N operator seats |
| Agent seats | $29/mo per active agent — covers heartbeat scheduling, session management, skill delivery |
| Action metering | $0.50 per 1,000 logged actions beyond included quota |
| Approval gates | Included in platform fee (governance should not be a tax) |
| AI provider costs | Pass-through with optional markup (5–15%) or BYOK (bring your own key) |
8.3 Why Hybrid Wins for Orchestration
- The value is in coordination, not computation. The orchestrator's value is routing, context, and governance — a platform capability that argues for a platform fee.
- Agent costs vary wildly. Claude Opus costs ~10x more per token than Haiku. Pass through AI costs or let users BYOK.
- Approval gates must not be metered. If you charge per approval, users will disable approvals to save money.
- Per-agent pricing captures fleet scale. A company running 3 agents needs fundamentally less infrastructure than one running 30.
- Action metering captures intensity. Two companies with 10 agents each may have 10x different action volumes.
8.4 Competitive Positioning
| Platform | Model | UI Tier Pricing |
|---|---|---|
| Microsoft Copilot Studio | Per-agent ($200/agent/mo) + per-message | Enterprise only |
| CrewAI Enterprise | Per-seat + usage | $199–$999/mo |
| LangGraph Cloud | Usage-based (per-run) | Pay-as-you-go |
| n8n Cloud | Per-workflow execution | $24–$288/mo |
| Paperclip (proposed) | Hybrid: platform + agent seats + metered actions | $99–$299/mo + $29/agent |
8.5 Feature Gating by Tier
| Feature | Starter ($99/mo) | Pro ($199/mo) | Enterprise ($299+/mo) |
|---|---|---|---|
| Operator seats | 2 | 5 | Unlimited |
| Active agents | 5 | 15 | Unlimited |
| Chat interface | Yes | Yes | Yes |
| Action feed | Last 24h | Full history | Full + export |
| Approval gates | Basic (approve/deny) | Conditional rules | Custom policies + SLA |
| Audit trail | 30 days | 1 year | Unlimited + compliance export |
| Agent types | Local adapters only | Local + OpenClaw gateway | All + custom adapters |
| SSO / SAML | No | No | Yes |
| Included actions | 5,000/mo | 25,000/mo | 100,000/mo |
| Overage | $1/1,000 actions | $0.75/1,000 | $0.50/1,000 |
8.6 Revenue Projections
For Nucleotto's current setup (6 agents, 1 operator, ~500 actions/day):
| Component | Monthly Cost |
|---|---|
| Pro platform | $199 |
| 6 agent seats × $29 | $174 |
| ~15,000 actions (within Pro quota) | $0 |
| AI provider pass-through (est.) | $150–$600 |
| Total | $523–$973/mo |
At scale (enterprise customer, 50 agents, 5 operators):
| Component | Monthly Cost |
|---|---|
| Enterprise platform | $299 |
| 50 agent seats × $29 | $1,450 |
| ~200,000 actions (100k included + 100k overage) | $50 |
| AI provider pass-through | $2,000–$10,000 |
| Total | $3,799–$11,799/mo |
8.7 Implementation Considerations
- Build metering early. Every action, approval, and heartbeat should emit a billable event from day one.
- Make the free tier generous. 1 operator, 2 agents, 1,000 actions/mo. Chat + action feed should be free to drive adoption.
- AI costs as pass-through, not margin. Keep it transparent (5–10% infrastructure fee) or offer BYOK.
- Approval gates are the moat. The governance layer is the highest-value feature. Never gate it behind the highest tier.
- Price OpenClaw gateway access at Pro tier and above. Gateway agents require more infrastructure and attract more sophisticated users.
Conclusion
Native local adapters are the right default for most Paperclip deployments. They offer superior reliability, lower latency, simpler configuration, and lower operational cost. The direct-execution model eliminates an entire class of failure modes related to gateway connectivity, WebSocket timeouts, and device pairing.
OpenClaw gateway adapters serve an important role for agent diversity and remote execution, but they come with meaningful operational overhead. Organizations should reserve gateway adapters for cases where the agent capability cannot be achieved locally, and invest in robust monitoring and timeout configuration when using them.
The hybrid approach — native adapters for core operational roles, OpenClaw for specialized capabilities — appears to be the most pragmatic strategy for production agent teams.