it0/packages/openclaw-bridge
hailin c9ee93fffd feat(instance-chat): full multimodal attachment support via OpenClaw bridge
After verifying that the OpenClaw gateway's chat.send WebSocket RPC
accepts an 'attachments' array (confirmed from openclaw/openclaw source
and documentation), implement end-to-end image/file attachment support
for instance chat:

Bridge (openclaw-client.ts):
- chatSendAndWait() now accepts optional `attachments[]` parameter
- Passes attachments to chat.send RPC only when non-empty

Bridge (index.ts):
- /task-async accepts `attachments[]` from request body
- Forwards to chatSendAndWait unchanged

Backend (agent.controller.ts):
- executeInstanceTask() accepts IT0 attachment format
  { base64Data, mediaType, fileName? }
- Converts to OpenClaw format { name, mimeType, media: "data:..." }
- Saves attachments to conversation history via contextService
- Forwards to bridge via bridgeAttachments spread

Flutter (agent_instance_chat_remote_datasource.dart):
- createTask() now includes attachments in POST body when present

Flutter (chat_page.dart):
- Reverted Fix 5 (disabled button) — attachment button fully enabled
  in instance mode since the bridge now supports it

Attachment format (OpenClaw wire):
  { name: string, mimeType: string, media: "data:<mime>;base64,<data>" }

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09 21:18:14 -07:00
..
src feat(instance-chat): full multimodal attachment support via OpenClaw bridge 2026-03-09 21:18:14 -07:00
CHANNEL_DEV_GUIDE.md feat(bridge): DingTalk channel plugin + OpenClaw Protocol v3 rewrite 2026-03-08 05:10:01 -07:00
Dockerfile fix(bridge): bake AGENTS.md symlink into Docker image 2026-03-09 00:44:05 -07:00
README.md feat(openclaw): Phase 1 — server pool + agent instance deployment infrastructure 2026-03-07 11:11:21 -08:00
package-lock.json feat(bridge): DingTalk channel plugin + OpenClaw Protocol v3 rewrite 2026-03-08 05:10:01 -07:00
package.json feat(bridge): DingTalk channel plugin + OpenClaw Protocol v3 rewrite 2026-03-08 05:10:01 -07:00
start-dingtalk.sh feat(bridge): DingTalk channel plugin + OpenClaw Protocol v3 rewrite 2026-03-08 05:10:01 -07:00
supervisord.conf fix(openclaw-bridge): add --allow-unconfigured to gateway command 2026-03-08 07:25:39 -07:00
tsconfig.json feat(openclaw): Phase 1 — server pool + agent instance deployment infrastructure 2026-03-07 11:11:21 -08:00

README.md

IT0 OpenClaw Bridge

Custom Docker image that bundles the official OpenClaw agent with the IT0 Bridge process, enabling IT0's agent-service to manage and monitor OpenClaw instances.

Architecture

Container (single image, two processes via supervisord)
  ├── openclaw gateway  (internal port 18789, NOT exposed)
  └── it0-bridge        (external port 3000, exposed to IT0)
        ├── GET  /health    — liveness probe
        ├── GET  /status    — detailed status
        ├── POST /task      — submit task to OpenClaw
        ├── GET  /sessions  — list sessions
        └── GET  /metrics   — usage metrics

Build & Push

docker build -t it0hub/openclaw-bridge:latest .
docker push it0hub/openclaw-bridge:latest

Environment Variables

Variable Required Description
OPENCLAW_GATEWAY_TOKEN Yes Internal OpenClaw gateway auth token
CLAUDE_API_KEY Yes Anthropic API key (injected by IT0)
IT0_INSTANCE_ID Yes UUID from IT0's agent_instances table
IT0_AGENT_SERVICE_URL Yes IT0 agent-service URL for heartbeat

Deploy (via iAgent SSH)

docker run -d \
  --name openclaw-{instanceId} \
  --restart unless-stopped \
  -p {hostPort}:3000 \
  -v /data/openclaw/{instanceId}:/home/node/.openclaw \
  -e OPENCLAW_GATEWAY_TOKEN={token} \
  -e CLAUDE_API_KEY={claudeApiKey} \
  -e IT0_INSTANCE_ID={instanceId} \
  -e IT0_AGENT_SERVICE_URL=https://it0api.szaiai.com \
  it0hub/openclaw-bridge:latest