Files
fusion/plugins/fusion-plugin-paperclip-runtime
Fusion 3c387444d2 test(FN-2712): add runtime e2e and integration coverage
- Add OpenClaw runtime end-to-end tests covering execution flow and runtime contract behavior
- Add OpenClaw integration tests to validate plugin/runtime wiring in engine scenarios
- Add Paperclip runtime end-to-end and integration suites for equivalent cross-runtime coverage
- Update Hermes, OpenClaw, and Paperclip manifest descriptions for consistent runtime metadata
2026-04-27 11:58:31 -07:00
..
2026-04-26 21:27:49 -07:00

Paperclip Runtime Plugin

fusion-plugin-paperclip-runtime provides the paperclip runtime for Fusion agents by calling a running Paperclip REST API instance.

This plugin no longer delegates to Fusion's internal @fusion/engine pi runtime.

Runtime Identity

  • Plugin ID: fusion-plugin-paperclip-runtime
  • Runtime ID: paperclip
  • Runtime Name: Paperclip Runtime

Prerequisites

  1. Paperclip is installed and running (default URL: http://localhost:3100)
  2. Fusion plugin installed:
fn plugin install ./plugins/fusion-plugin-paperclip-runtime

Configuration

The runtime resolves configuration in this priority order:

  1. Plugin settings (ctx.settings)
  2. Environment variables
  3. Defaults
Setting Env Var Required Default
apiUrl PAPERCLIP_API_URL No http://localhost:3100
apiKey PAPERCLIP_API_KEY No undefined
agentId PAPERCLIP_AGENT_ID Yes (for session create) undefined
companyId PAPERCLIP_COMPANY_ID Yes (for session create) undefined

Authentication Modes

  • Bearer token mode: set apiKey / PAPERCLIP_API_KEY and requests include Authorization: Bearer <token>
  • Local trusted mode: leave apiKey unset; plugin probes /api/health without auth and proceeds when allowed by Paperclip deployment mode

How Runtime Execution Works

For each prompt, the runtime adapter performs:

  1. POST /api/companies/{companyId}/issues (creates issue in backlog, assigned to agentId)
  2. POST /api/issues/{issueId}/checkout (atomic claim; 409 conflicts are logged and execution continues)
  3. POST /api/agents/{agentId}/heartbeat/invoke (async agent execution)
  4. Polls GET /api/issues/{issueId} with exponential backoff (2s → 4s → 8s → 10s cap, 120s timeout)
  5. Reads output from GET /api/issues/{issueId}/comments
  6. Emits text/thinking/tool callbacks back to Fusion runtime consumers

The runtime uses Paperclip as the orchestration engine; Fusion receives summarized output via issue comments.

Runtime Selection in Fusion

Configure an agent with runtime hint paperclip:

{
  "runtimeConfig": {
    "runtimeHint": "paperclip"
  }
}

Fusion runtime resolution still falls back to default pi runtime if plugin runtime resolution fails.

Development

cd plugins/fusion-plugin-paperclip-runtime
pnpm test
pnpm build