7.5 KiB
Warp ACP Integration
Purpose
This document defines the long-term design for routing ACP harnesses through Warp-managed cloud providers. Phase 1 standardizes opencode; future phases may extend the same pattern to gemini cli and claude code.
Scope
- Control plane: OpenClaw on
mac-5 - Execution nodes:
mac-6,mac-7 - Current phase:
opencode - Future candidates:
gemini cli,claude code
Core Design Principles
- Provider identity and model identity are different things.
- Model names can repeat across providers.
- Environment variables and agent ids must therefore encode the provider, not just the model.
- Do not rely on
~/.zshrcfor ACP runtime secrets.- ACP / acpx / harness execution may not inherit interactive shell startup files.
- Secrets should be loaded explicitly.
- Secrets and routing rules should be separated.
- Secrets live in
~/.openclaw/.env. - Routing / alias / model selection live in ACP config, wrapper scripts, and documented policy.
- Secrets live in
- Wrapper scripts are the stable injection point.
- Wrapper scripts should explicitly load
~/.openclaw/.env, validate required variables, and then exec the target harness.
- Wrapper scripts should explicitly load
- Fallback must be designed up front.
- Cloud provider quota exhaustion and rate limiting are expected operating conditions, not edge cases.
Secret Storage Standard
Primary local secret file:
~/.openclaw/.env
Node-local requirement:
- Any machine that may locally execute a Warp-backed ACP harness must have its own local
~/.openclaw/.env. - For the current cluster plan, this means
mac-5,mac-6, andmac-7should all be configured. - Do not assume secrets from
mac-5will automatically be available when a harness actually runs onmac-6ormac-7.
Recommended format:
WARP_INFINI_API_KEY=
WARP_INFINI_BASE_URL=https://cloud.infini-ai.com/maas/coding/v1
WARP_CKIMI_API_KEY=
WARP_CKIMI_BASE_URL=
Notes:
- Use plain
KEY=valuelines. - Do not store secrets in
~/.openclaw/openclaw.json,~/.acpx/config.json, or long-term memory files. - Restrict file permissions:
chmod 600 ~/.openclaw/.env.
Environment Variable Naming Rule
Use the pattern:
WARP_<PROVIDER>_API_KEYWARP_<PROVIDER>_BASE_URL
Examples:
WARP_INFINI_API_KEYWARP_INFINI_BASE_URLWARP_CKIMI_API_KEYWARP_CKIMI_BASE_URL
Do not name variables by model alone, because identical model names may exist on multiple providers.
Agent Naming Standard
For Warp-backed ACP harnesses, use:
<harness>-warp-<provider>-<model-family>
Phase 1 examples for opencode:
opencode-warp-infini-kimiopencode-warp-infini-minimaxopencode-warp-infini-glm
Future examples:
gemini-warp-infini-kimiclaude-warp-ckimi-kimi
Current Default Model Policy (2026-03-18)
The cluster no longer uses a single "default to each machine's own local model" rule for opencode ACP.
Current node-specific default policy:
mac-5: defaultopencodemodel isopencode/minimax-m2.5-freemac-6: defaultopencodemodel isvllm/Qwen3.5-27Bviahttp://100.64.0.5:8000/v1mac-7: defaultopencodemodel isvllm/Qwen3.5-27Bviahttp://100.64.0.5:8000/v1
Operational meaning:
mac-5prefers the already-validated free cloud minimax route for daily ACP stability.mac-6andmac-7prefer the shared local vLLM endpoint instead of their previous per-node localoMLXdefault foropencodeACP.- This rule is specific to current
opencodedefaults; it does not invalidate separate worker/subagent topology docs.
Observed validation status:
mac-5: directopencodeand ACP minimal tests succeeded withopencode/minimax-m2.5-freemac-6: ACP minimal test succeeded withvllm/Qwen3.5-27Bmac-7: ACP minimal test succeeded withvllm/Qwen3.5-27B
Configuration Layer Responsibilities
OpenClaw
Responsible for:
- Allowing ACP agent ids to be called
- High-level routing policy
Key file:
~/.openclaw/openclaw.json
acpx
Responsible for:
- Mapping ACP
agentIdto a concrete command
Key file:
~/.acpx/config.json
Wrapper scripts
Responsible for:
- Loading
~/.openclaw/.env - Validating provider secrets / URLs
- Fixing provider and model selection
- Launching the harness ACP command
Suggested location:
~/.local/bin/
Harness config (opencode in phase 1)
Responsible for:
- Harness-specific provider usage and model invocation details
Key file:
~/.config/opencode/opencode.json
Wrapper Contract
Every Warp-backed ACP wrapper should:
- Load
~/.openclaw/.env - Validate that required variables exist
- Select the target provider
- Pin the intended model
- Launch the harness ACP entrypoint
- Fail fast with a readable error if env/config is missing
Pseudo-flow:
set -a
source ~/.openclaw/.env
set +a
# validate WARP_<PROVIDER>_API_KEY and WARP_<PROVIDER>_BASE_URL
# select model
exec opencode-ai acp
Fallback Policy
Why fallback exists
Warp-backed cloud providers may fail due to:
- 5-hour quota exhaustion
- weekly quota exhaustion
- rate limiting / throttling
- transient upstream 5xx
- model retirement or temporary unavailability
- provider auth / billing issues
These are normal operational conditions and must be documented as first-class routing rules.
Fallback priority
When a primary provider/model is unavailable, use this order:
- Same model, different provider
- Same provider, adjacent model
- Different provider, adjacent model
This preserves behavior consistency as much as possible before changing model family.
Example fallback chain
For opencode-warp-infini-kimi:
- primary:
infini / kimi-k2.5 - fallback-1:
ckimi / kimi-for-coding - fallback-2:
infini / glm-5 - fallback-3:
infini / minimax-m2.5
For opencode-warp-ckimi-kimi-for-coding:
- primary:
ckimi / kimi-for-coding - fallback-1:
infini / kimi-k2.5 - fallback-2:
infini / glm-5 - fallback-3:
infini / minimax-m2.5
Exact fallback order should be documented per agent as providers are added.
ACP continuation rule after provider limit / request failure
When an ACP task fails mid-run because a provider is limited, rate-limited, quota-exhausted, or otherwise request-blocked, the system should not just restart blindly.
Use this continuation rule:
- detect that the failure is provider/request related rather than task-logic related
- produce a concise task-state summary of what had already been completed, what failed, and what remains
- start a new
opencodeACP run using the next Warp fallback agent - pass the summary into the new run so the replacement agent can continue instead of redoing everything from scratch
The summary should include, when available:
- original task goal
- completed steps
- files changed or attempted
- command outputs or relevant error lines
- exact provider failure signal (for example rate limit / quota exhaustion)
- remaining work
This behavior is part of the Warp fallback design, especially for long-running coding tasks where provider limits may interrupt execution mid-stream.
Operational Reminder
If runtime errors show quota exhaustion or provider-specific capacity limits during an ACP task, the operator should treat that as a routing event, not just a task failure. The next step is to move to the documented fallback provider/model path.
Extension Path
After opencode stabilizes, the same naming / secret-loading / fallback framework should be reused for:
gemini cliclaude code
The framework should stay provider-centric and wrapper-based even as the harnesses differ.