From 2cb3c83ce29d35bcb12f74c7f7653c74481c8873 Mon Sep 17 00:00:00 2001 From: mlax001-code Date: Thu, 28 May 2026 23:18:01 +0800 Subject: [PATCH 1/2] feat: add OpenClaw ACP agent runtime Adds OpenClaw as a supported ACP-based coding agent runtime. OpenClaw speaks ACP over stdio natively (no --accept-hooks needed). Falls back to a static model list when model detection is unavailable. --- apps/daemon/src/runtimes/defs/openclaw.ts | 34 +++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 apps/daemon/src/runtimes/defs/openclaw.ts diff --git a/apps/daemon/src/runtimes/defs/openclaw.ts b/apps/daemon/src/runtimes/defs/openclaw.ts new file mode 100644 index 000000000..b5d436852 --- /dev/null +++ b/apps/daemon/src/runtimes/defs/openclaw.ts @@ -0,0 +1,34 @@ +import { detectAcpModels, DEFAULT_MODEL_OPTION } from './shared.js'; +import type { RuntimeAgentDef } from '../types.js'; + +export const openclawAgentDef = { + id: 'openclaw', + name: 'OpenClaw', + bin: 'openclaw', + versionArgs: ['--version'], + fetchModels: async (resolvedBin, env) => + detectAcpModels({ + bin: resolvedBin, + args: ['acp'], + env, + timeoutMs: 15_000, + defaultModelOption: DEFAULT_MODEL_OPTION, + }), + fallbackModels: [ + DEFAULT_MODEL_OPTION, + // MiniMax — OpenClaw's default provider + { id: 'minimax/MiniMax-M2.7', label: 'MiniMax-M2.7 (default)' }, + { id: 'minimax/MiniMax-M4', label: 'MiniMax-M4' }, + // Anthropic via OpenClaw gateway + { id: 'anthropic/claude-opus-4-5', label: 'Claude Opus 4.5' }, + { id: 'anthropic/claude-sonnet-4-6', label: 'Claude Sonnet 4.6' }, + { id: 'anthropic/claude-haiku-4-5', label: 'Claude Haiku 4.5' }, + // OpenAI via OpenClaw gateway + { id: 'openai/gpt-5', label: 'GPT-5' }, + { id: 'openai/gpt-4o', label: 'GPT-4o' }, + ], + buildArgs: () => ['acp'], + streamFormat: 'acp-json-rpc', + mcpDiscovery: 'mature-acp', + externalMcpInjection: 'acp-merge', +} satisfies RuntimeAgentDef; From c0e4b1761bd4b0900117870dfe0700926966957d Mon Sep 17 00:00:00 2001 From: mlax001-code Date: Thu, 28 May 2026 23:18:28 +0800 Subject: [PATCH 2/2] feat: register OpenClaw agent in registry Adds openclawAgentDef to BASE_AGENT_DEFS and imports it alongside existing ACP runtimes (Hermes, Kimi, Vibe). --- apps/daemon/src/runtimes/registry.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/daemon/src/runtimes/registry.ts b/apps/daemon/src/runtimes/registry.ts index b2d2ef278..90e252914 100644 --- a/apps/daemon/src/runtimes/registry.ts +++ b/apps/daemon/src/runtimes/registry.ts @@ -4,6 +4,7 @@ import { codexAgentDef } from './defs/codex.js'; import { devinAgentDef } from './defs/devin.js'; import { geminiAgentDef } from './defs/gemini.js'; import { opencodeAgentDef } from './defs/opencode.js'; +import { openclawAgentDef } from './defs/openclaw.js'; import { hermesAgentDef } from './defs/hermes.js'; import { traeCliAgentDef } from './defs/trae-cli.js'; import { grokBuildAgentDef } from './defs/grok-build.js'; @@ -29,6 +30,7 @@ const BASE_AGENT_DEFS: RuntimeAgentDef[] = [ devinAgentDef, geminiAgentDef, opencodeAgentDef, + openclawAgentDef, hermesAgentDef, traeCliAgentDef, grokBuildAgentDef,