← 返回 Skills 市场
romainsantoli-web

Firm Acp Bridge

作者 romainsantoli-web · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
409
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install firm-acp-bridge
功能描述
Haute disponibilité du bridge ACP et gestion des sessions agents autonomes. Comble les gaps C4 (ACP sans persistance), H3 (sessions spawn sans provider env),...
使用说明 (SKILL.md)

firm-acp-bridge

⚠️ Contenu généré par IA — validation humaine requise avant déploiement en production.

Purpose

Ce skill rend le bridge ACP résilient aux crashs et les sessions agents autonomes pleinement fonctionnelles en comblant les gaps découverts dans openclaw/openclaw.

Gaps couverts :

Gap Sévérité Outil
C4 — ACP sessions en mémoire uniquement (crash = perte) CRITICAL acp_session_persist/restore
H3 — Sessions spawn/cron sans provider env vars HIGH fleet_session_inject_env
H4 — Cron tools sur denylist sandbox HIGH fleet_cron_schedule
H5 — Race condition shared-workspace read/write HIGH openclaw_workspace_lock

Tools activés

acp_session_persist       — persiste run_id → gateway_session_key sur disque (C4)
acp_session_restore       — recharge sessions après crash/restart bridge (C4)
acp_session_list_active   — liste sessions ACP actives et stale (C4)
fleet_session_inject_env  — injecte provider env vars dans sessions non-main (H3)
fleet_cron_schedule       — planifie cron tasks sur session main (H4)
openclaw_workspace_lock   — advisory lock pour éviter les race conditions (H5)

Protocole ACP Persistence (C4)

Problème : Si le bridge openclaw acp crashe ou est tué (OOM, reboot), tous les mappings run_id → gateway_session_key en mémoire sont perdus. Les IDE integrations (VS Code, Cursor) se reconnectent silencieusement à de nouvelles sessions.

Intégration côté bridge (pattern d'appel)

À chaque création de session ACP, appeler immédiatement :

{
  "tool": "acp_session_persist",
  "args": {
    "run_id": "\x3Cacp_run_id>",
    "gateway_session_key": "\x3Cgateway_key>",
    "metadata": {
      "ide": "vscode",
      "workspace": "/path/to/project",
      "created_by": "agent-name"
    }
  }
}

Au démarrage du bridge (après crash ou restart) :

{
  "tool": "acp_session_restore",
  "args": { "max_age_hours": 24 }
}

→ Retourne les sessions récupérables + purge automatique des sessions > 24h stale.

Pour monitorer :

{
  "tool": "acp_session_list_active",
  "args": { "include_stale": false }
}

Décision d'architecture — ACP session store

Option Décision Raison
Redis ❌ NON Trop lourd pour single-operator, dépendance externe
SQLite ❌ NON Overkill pour des clés simples, migration schema
JSON file (atomic rename) ✅ OUI Zéro dépendance, atomic write (tmp + os.replace), léger

Autonomous Session Bootstrap (H3)

Problème : Les sessions spawned via sessions_spawn ou cron n'ont pas accès aux env vars des providers configurés (ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.). Tout appel LLM dans une session non-main échoue silencieusement.

Séquence obligatoire avant sessions_spawn

Étape 1 — Validation dry_run (vérifier les clés sans envoyer) :

{
  "tool": "fleet_session_inject_env",
  "args": {
    "env_vars": {
      "ANTHROPIC_API_KEY": "\x3Cyour_key>",
      "OPENCLAW_MODEL": "claude-3-5-sonnet-20241022"
    },
    "dry_run": true
  }
}

→ Vérifie que les clés passent l'allowlist. Si rejected non vide, les clés sont invalides.

Étape 2 — Injection effective avant spawn :

{
  "tool": "fleet_session_inject_env",
  "args": {
    "env_vars": {
      "ANTHROPIC_API_KEY": "\x3Cyour_key>",
      "OPENCLAW_MODEL": "claude-3-5-sonnet-20241022"
    },
    "filter_tags": ["engineering", "quality"]
  }
}

Étape 3 — Spawn la session (via Gateway direct) :

{
  "method": "sessions_spawn",
  "params": {
    "agent": "engineering",
    "reply_session": "main"
  }
}

Clés autorisées (allowlist intégrée)

ANTHROPIC_API_KEY | OPENAI_API_KEY | OPENROUTER_API_KEY | GEMINI_API_KEY
OPENCLAW_MODEL | OPENCLAW_PROVIDER | OPENCLAW_MAX_TOKENS
CLAW_MODEL | CLAW_PROVIDER | PROXY_URL | CUSTOM_*

Jamais dans les logs — les valeurs sont masquées avec ****{last4}.

Cron Outside Sandbox (H4)

Problème : cron tools sont sur la denylist dans les sessions Docker sandbox. Tout workflow autonome planifié dans un container non-main est bloqué.

Solution : Planifier sur la session main (accès hôte) via fleet_cron_schedule.

{
  "tool": "fleet_cron_schedule",
  "args": {
    "command": "node scripts/daily-report.js",
    "schedule": "0 9 * * 1-5",
    "session": "main",
    "description": "Daily business report — Monday to Friday 9h"
  }
}

Utiliser fleet_cron_schedule quand :

  • ✅ La tâche est un script léger et déterministe
  • ✅ La tâche ne nécessite pas d'isolation sécurité
  • ✅ La command passe l'allowlist [a-zA-Z0-9 /._-=]+

Utiliser sessions_spawn (session non-main) quand :

  • ✅ La tâche implique du code non vérifié / externe
  • ✅ Isolation sécurité requise (sandbox Docker)
  • ✅ La tâche peut se déclencher ad-hoc (pas planifiée)

Workspace Locking (H5)

Problème : Race condition documentée (#29947) sur shared-workspace read/modify/write. Plusieurs sessions agent peuvent corrompre la même ressource partagée.

Pattern acquire / work / release

// 1. Acquérir le lock
{
  "tool": "openclaw_workspace_lock",
  "args": {
    "path": "shared/config.json",
    "action": "acquire",
    "owner": "engineering-session-001",
    "timeout_s": 30
  }
}

// 2. Faire le travail (read → modify → write)
// ... vos opérations sur la ressource ...

// 3. Libérer le lock
{
  "tool": "openclaw_workspace_lock",
  "args": {
    "path": "shared/config.json",
    "action": "release",
    "owner": "engineering-session-001"
  }
}

Vérifier le statut d'un lock :

{
  "tool": "openclaw_workspace_lock",
  "args": {
    "path": "shared/config.json",
    "action": "status",
    "owner": "any"
  }
}

Règles

  • Le lock est advisory (pas kernel-level) — tous les agents doivent coopérer
  • timeout_s max = 300s. Si lock non acquis → ok: false + current_owner
  • Toujours release dans un bloc try/finally pour éviter les locks orphelins
  • Un lock expired ne se libère pas automatiquement — utiliser acp_session_restore pour purger les owners stale

Monitoring de santé ACP

Flux de monitoring recommandé (à exécuter périodiquement) :

acp_session_list_active → sessions stale > 2h → acp_session_restore(max_age_hours=2) → recheck

Si restored: 0 et purged > 0 après un intervalle normal → le bridge a crashé et les sessions ont été perdues → notifier via firm_export_slack_digest.


OpenClaw gaps : C4 (ACP in-memory), H3 (#29886 isolated sessions no provider env), H4 (#29921 cron sandbox denylist), H5 (#29947 race condition)


💎 Support

Si ce skill vous est utile, vous pouvez soutenir le développement :

Dogecoin : DQBggqFNWsRNTPb6kkiwppnMo1Hm8edfWq

安全使用建议
This skill describes useful patterns for persistence, env injection, cron scheduling, and workspace locking, but it gives agents the authority to persist data to disk, distribute provider API keys into spawned sessions, and schedule commands to run on the host session. Before installing, verify the following with a human reviewer: 1) Where will the session JSON store live? Restrict its path, ownership, and encrypt it if it contains secrets or keys. 2) Which sessions are allowed to receive injected provider keys? Never inject secrets into untrusted or user-submitted session code; prefer a secrets manager or ephemeral short-lived credentials. 3) Audit and approval policy for fleet_cron_schedule commands — ensure allowlist enforcement and human review for any host-level command. 4) Confirm the real implementations of the listed tools (mcp-openclaw-extensions / @agentclientprotocol/sdk) — inspect their code and access model. 5) Understand logging/masking guarantees: the SKILL.md says values are masked, but masking must be enforced by the runtime, not just requested. If you cannot confirm these controls, do not deploy this into production or to agents that can run unvetted code. Additional info (exact storage paths, access control, tool implementations) would raise confidence and could change this assessment.
功能分析
Type: OpenClaw Skill Name: firm-acp-bridge Version: 1.0.0 The skill introduces high-risk capabilities, primarily through the `fleet_cron_schedule` tool, which allows scheduling commands on the host system ('main' session). While the documentation specifies a restrictive regex allowlist (`[a-zA-Z0-9 /._-=]+`) for commands, this capability inherently presents a significant Remote Code Execution (RCE) vulnerability if the allowlist is bypassed or flawed. Additionally, the `fleet_session_inject_env` tool handles and injects sensitive API keys into agent sessions, which is a high-privilege operation, even with an integrated allowlist and logging redaction. These capabilities, while intended to address functional gaps, introduce substantial security risks that warrant a 'suspicious' classification due to their potential for misuse or exploitation.
能力评估
Purpose & Capability
The name/description (ACP persistence, session bootstrap, cron, workspace locks) aligns with the toolkit the SKILL.md enumerates (acp_session_persist/restore, fleet_session_inject_env, fleet_cron_schedule, openclaw_workspace_lock). Metadata declares dependencies (mcp-openclaw-extensions, @agentclientprotocol/sdk) that could plausibly provide those tools. However, the skill instructs handling provider API keys and persistent file storage but declares no required environment variables or storage/config paths — a mismatch worth noting.
Instruction Scope
The runtime instructions tell the agent to: write a JSON session store to disk (atomic rename pattern), inject provider API keys into non-main/spawned sessions, and schedule cron commands to run on the 'main' (host) session. These operations go beyond pure in-memory orchestration: they involve writing persistent files, distributing secrets to other sessions, and running host-level commands. The SKILL.md asks for masking in logs but provides no enforceable mechanism. The instructions therefore grant the agent broad discretion to handle secrets and host-level execution.
Install Mechanism
This is an instruction-only skill with no install spec and no code files. That minimizes disk-installed code risk; however, the instructions cause the agent to call tools that must exist in the runtime environment (provided by the declared dependencies).
Credentials
The skill discusses injecting provider credentials (ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY, etc.) into sessions and lists a broad allowlist of variable names, but the skill metadata requests no env vars and no primary credential. Asking the agent to move or inject sensitive API keys without declaring them or constraining how they're stored/exposed is disproportionate and potentially dangerous (secret propagation to less-trusted sessions).
Persistence & Privilege
Although always:false and agent invocation is normal, the instructions explicitly schedule host-level cron commands via the 'main' session and persist session mappings to disk. Both create persistent side-effects and raise privilege concerns: jobs running on 'main' gain host access, and a persistent file containing session->gateway mappings (path unspecified) becomes a sensitive artifact. The skill does not specify access controls, encryption, or storage location constraints.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install firm-acp-bridge
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /firm-acp-bridge 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
firm-acp-bridge v1.0.0 - Initial release, addressing reliability and session management gaps in openclaw/openclaw. - Adds persistence for ACP session mappings to prevent data loss on crash/restart (C4 gap). - Enables injection of provider environment variables into spawned/cron sessions (H3 gap). - Provides safe cron task scheduling on main session to bypass sandbox restrictions (H4 gap). - Implements advisory workspace file locking to prevent race conditions on shared resources (H5 gap). - Includes tools for session monitoring, restoration, and environment management. - No external dependencies; session data is stored using atomic local JSON file writes.
元数据
Slug firm-acp-bridge
版本 1.0.0
许可证
累计安装 1
当前安装数 1
历史版本数 1
常见问题

Firm Acp Bridge 是什么?

Haute disponibilité du bridge ACP et gestion des sessions agents autonomes. Comble les gaps C4 (ACP sans persistance), H3 (sessions spawn sans provider env),... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 409 次。

如何安装 Firm Acp Bridge?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install firm-acp-bridge」即可一键安装,无需额外配置。

Firm Acp Bridge 是免费的吗?

是的,Firm Acp Bridge 完全免费(开源免费),可自由下载、安装和使用。

Firm Acp Bridge 支持哪些平台?

Firm Acp Bridge 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Firm Acp Bridge?

由 romainsantoli-web(@romainsantoli-web)开发并维护,当前版本 v1.0.0。

💬 留言讨论