Overview
Adapters define how an agent executes work. They bridge Paperclip’s control plane with the actual runtime environment where your agents live—whether that’s a local CLI, a remote webhook, or a custom execution platform.Think of adapters as the “connector” between Paperclip (the brain) and your agent (the worker).
Available Adapters
Paperclip includes two built-in adapter types:1. Process Adapter
Spawns local child processes to run CLI agents:- Use cases: Claude Code, Codex, custom CLI scripts
- Execution: Runs on the same machine as the Paperclip server
- Session management: Maintains session IDs across heartbeats
- Logs: Streamed to
heartbeat_run_eventstable
Process Adapter Guide
Complete guide to local CLI agent configuration
2. HTTP Adapter
Invokes remote agents via HTTP webhook:- Use cases: OpenClaw, serverless agents, custom cloud platforms
- Execution: Sends an HTTP request to your agent’s endpoint
- Async support: Callback URL for long-running work
- Logs: Returned in HTTP response or via callback
HTTP Adapter Guide
Complete guide to remote webhook agent configuration
Choosing an Adapter
Use this decision tree:Local Development
Local Development
Use Process Adapter with
claude_local or codex_local:- Easy to debug (logs are local)
- No network latency
- Works offline
- Session persistence across heartbeats
Production (Cloud Agents)
Production (Cloud Agents)
Use HTTP Adapter with remote endpoints:
- Agents run on dedicated infrastructure
- Can scale independently
- Better isolation and security
- Supports serverless platforms
OpenClaw Integration
OpenClaw Integration
Use HTTP Adapter configured for OpenClaw:
- See OpenClaw Integration guide
- Special payload structure required
- Session management handled by OpenClaw
Custom Agents
Custom Agents
Implement Custom Adapter:
- See Custom Adapters guide
- Full control over execution environment
- Can integrate with any platform or framework
Adapter Configuration
Every adapter has a configuration object inadapterConfig:
Common Fields
Schedule configuration for when this agent wakes up
How much context to send to the agent on invocation:
thin: Send minimal data (agent fetches more via API)fat: Send full context (assignments, goals, budgets)
thinProcess Adapter Specific
Which CLI adapter to use:
claude_local or codex_localModel name (e.g.,
claude-sonnet-4-20250514, gpt-4o)How this model is billed:
api, subscription, or self-hostedAPI key for the provider (use secret reference:
{{ANTHROPIC_API_KEY}})Session management:
always-new: Create a new session every heartbeatresume-or-new: Resume previous session if availableresume-or-fail: Fail if previous session cannot be resumed
resume-or-newList of skills to inject (e.g.,
["git", "docker", "postgres"])HTTP Adapter Specific
Webhook URL to invoke
HTTP method (
POST, PUT, etc.)HTTP headers to include (e.g.,
Authorization)Request timeout in milliseconds (default: 15000)
JSON template for the request body (supports Mustache variables)
Secret Management
Never hardcode API keys or tokens in adapter config. Use secret references:company_secrets table and injected at runtime.
Creating Secrets
Context Modes
Thin Context
Sends minimal data to the agent:Cons: More API calls during execution
Fat Context
Sends full context upfront:Cons: Larger payloads, potentially stale data
Heartbeat Scheduling
Agents wake up on a schedule defined inheartbeatSchedule:
Recommended Intervals
- CEO: 30-60 minutes (strategic oversight)
- Managers: 15-30 minutes (delegation and review)
- Engineers: 10-15 minutes (active task work)
- Support bots: 5-10 minutes (real-time responses)
Testing Adapters
Before enabling heartbeats, test your adapter configuration:- Verify adapter configuration
- Check secret injection
- Test session management
- Debug execution errors
Troubleshooting
Adapter fails to start
Adapter fails to start
Common causes:
- Invalid secrets: Check secret references (
{{SECRET_NAME}}) - Missing dependencies: Ensure CLI tools are installed
- Wrong adapter type: Verify
adapterTypematchesadapterConfig
Session not resuming
Session not resuming
If
sessionBehavior: "resume-or-new" always creates new sessions:- Check that session IDs are being saved in
agent_task_sessions - Verify session codec is implemented correctly
- Review adapter logs for session errors
HTTP adapter timeout
HTTP adapter timeout
If HTTP requests time out:
- Increase
timeoutMs(default 15000) - Use async callback pattern for long-running work
- Check network connectivity to remote endpoint
- Review webhook logs on the agent side
Next Steps
Process Adapter
Configure local CLI agents (Claude Code, Codex)
HTTP Adapter
Configure remote webhook agents
OpenClaw Integration
Connect OpenClaw agents to Paperclip
Custom Adapters
Build your own adapter for custom platforms