Skip to content

feat(agent): add remote agent support with OpenClaw protocol#1739

Merged
IceyLiu merged 6 commits intoiOfficeAI:mainfrom
TCP404:feat/remote-agent
Mar 27, 2026
Merged

feat(agent): add remote agent support with OpenClaw protocol#1739
IceyLiu merged 6 commits intoiOfficeAI:mainfrom
TCP404:feat/remote-agent

Conversation

@TCP404
Copy link
Copy Markdown
Collaborator

@TCP404 TCP404 commented Mar 26, 2026

Summary

  • Add remote agent support with protocol-agnostic architecture (OpenClaw as first implementation)
  • Per-agent Ed25519 device identity with encrypted credential storage, full pairing approval flow
  • Settings UI for CRUD operations, conversation lifecycle (create, send, receive, resume sessions)

Changes

Core Architecture

  • New RemoteAgentCore and RemoteAgentManager (runs in-process, no worker fork via enableFork flag)
  • OpenClawGatewayConnection supports external device identity injection (isolated from local ~/.openclaw/identity/)
  • Protocol-specific connection handling delegated from RemoteAgentCore

Database

  • Migration v17: 4 new columns on remote_agents (device_id, device_public_key, device_private_key, device_token)
  • Encrypted storage for sensitive fields using existing credentialCrypto
  • Full CRUD with camelCase ↔ snake_case mapping in IPC bridge

IPC & Bridge

  • remoteAgent IPC namespace: list, get, create, update, delete, testConnection, handshake
  • Handshake handler with pairing detection (structured error + regex fallback)
  • Session key persistence across conversation resumption

Settings UI

  • Remote agent management panel with add/edit/delete
  • OpenClaw pairing approval flow: 5s polling, 5min timeout, cancel support
  • Agent name display in conversation send box

i18n

  • All 6 locales updated (en-US, zh-CN, zh-TW, ja-JP, ko-KR, tr-TR)

Related Issue

Closes #1738

Test Plan

  • Add remote agent in Settings → verify handshake executes and DB stores encrypted device keys
  • Test pairing approval flow with unapproved device → verify polling UI and timeout
  • Test already-paired device → verify immediate connection success
  • Edit remote agent config (name, URL, avatar) → verify changes persist
  • Create conversation with remote agent → verify messages send/receive correctly
  • Resume session (close and reopen conversation) → verify session key continuity
  • Verify local OpenClaw gateway sessions unaffected (regression)
  • Verify ~/.openclaw/identity/device.json not modified by remote agent operations

Implement full remote agent lifecycle: device identity generation,
OpenClaw Gateway handshake with pairing approval flow (5s poll, 5min
timeout), encrypted credential storage, and per-agent Ed25519 keypairs
stored in database instead of shared ~/.openclaw/identity/.
huangpeirong added 3 commits March 26, 2026 15:59
Add comprehensive tests covering:
- RemoteAgentCore: connection errors, history fallback, tool events, session resolution, message routing
- remoteAgentBridge: handshake scenarios (ok, pending, error, timeout, regex fallback)
- RemoteAgentManagement: DOM tests for settings UI (render, agent list, empty state)
- RemoteSendBox: DOM tests for chat send box (stream events, initial message, stop)
- useGuidSend: remote agent conversation creation path
- usePresetAssistantInfo: remote agent info resolution
TCP404 added a commit that referenced this pull request Mar 26, 2026
Add comprehensive tests covering:
- RemoteAgentCore: connection errors, history fallback, tool events, session resolution, message routing
- remoteAgentBridge: handshake scenarios (ok, pending, error, timeout, regex fallback)
- RemoteAgentManagement: DOM tests for settings UI (render, agent list, empty state)
- RemoteSendBox: DOM tests for chat send box (stream events, initial message, stop)
- useGuidSend: remote agent conversation creation path
- usePresetAssistantInfo: remote agent info resolution
@piorpua piorpua added the bot:reviewing Review in progress (mutex) label Mar 27, 2026
@piorpua piorpua added bot:reviewing Review in progress (mutex) and removed bot:reviewing Review in progress (mutex) labels Mar 27, 2026
@piorpua piorpua added bot:reviewing Review in progress (mutex) and removed bot:reviewing Review in progress (mutex) labels Mar 27, 2026
@IceyLiu IceyLiu merged commit 4599785 into iOfficeAI:main Mar 27, 2026
14 checks passed
IceyLiu added a commit that referenced this pull request Mar 27, 2026
fix(agent): apply missing remote agent UI updates from #1739
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Remote agent support (OpenClaw as first protocol)

3 participants