mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 10:40:43 +00:00
test: add Droid ACP bind Docker lane
This commit is contained in:
@@ -30,10 +30,11 @@ openclaw_live_acp_bind_resolve_auth_provider() {
|
||||
case "${1:-}" in
|
||||
claude) printf '%s\n' "claude-cli" ;;
|
||||
codex) printf '%s\n' "codex-cli" ;;
|
||||
droid) printf '%s\n' "droid" ;;
|
||||
gemini) printf '%s\n' "google-gemini-cli" ;;
|
||||
opencode) printf '%s\n' "opencode" ;;
|
||||
*)
|
||||
echo "Unsupported OPENCLAW_LIVE_ACP_BIND agent: ${1:-} (expected claude, codex, gemini, or opencode)" >&2
|
||||
echo "Unsupported OPENCLAW_LIVE_ACP_BIND agent: ${1:-} (expected claude, codex, droid, gemini, or opencode)" >&2
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
@@ -43,6 +44,7 @@ openclaw_live_acp_bind_resolve_agent_command() {
|
||||
case "${1:-}" in
|
||||
claude) printf '%s' "${OPENCLAW_LIVE_ACP_BIND_AGENT_COMMAND_CLAUDE:-${OPENCLAW_LIVE_ACP_BIND_AGENT_COMMAND:-}}" ;;
|
||||
codex) printf '%s' "${OPENCLAW_LIVE_ACP_BIND_AGENT_COMMAND_CODEX:-${OPENCLAW_LIVE_ACP_BIND_AGENT_COMMAND:-}}" ;;
|
||||
droid) printf '%s' "${OPENCLAW_LIVE_ACP_BIND_AGENT_COMMAND_DROID:-${OPENCLAW_LIVE_ACP_BIND_AGENT_COMMAND:-}}" ;;
|
||||
gemini) printf '%s' "${OPENCLAW_LIVE_ACP_BIND_AGENT_COMMAND_GEMINI:-${OPENCLAW_LIVE_ACP_BIND_AGENT_COMMAND:-}}" ;;
|
||||
opencode) printf '%s' "${OPENCLAW_LIVE_ACP_BIND_AGENT_COMMAND_OPENCODE:-${OPENCLAW_LIVE_ACP_BIND_AGENT_COMMAND:-}}" ;;
|
||||
*) return 1 ;;
|
||||
@@ -95,9 +97,9 @@ export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
|
||||
export COREPACK_HOME="${COREPACK_HOME:-$XDG_CACHE_HOME/node/corepack}"
|
||||
export NPM_CONFIG_CACHE="${NPM_CONFIG_CACHE:-$XDG_CACHE_HOME/npm}"
|
||||
export npm_config_cache="$NPM_CONFIG_CACHE"
|
||||
mkdir -p "$NPM_CONFIG_PREFIX" "$XDG_CACHE_HOME" "$COREPACK_HOME" "$NPM_CONFIG_CACHE"
|
||||
mkdir -p "$NPM_CONFIG_PREFIX" "$HOME/.local/bin" "$XDG_CACHE_HOME" "$COREPACK_HOME" "$NPM_CONFIG_CACHE"
|
||||
chmod 700 "$XDG_CACHE_HOME" "$COREPACK_HOME" "$NPM_CONFIG_CACHE" || true
|
||||
export PATH="$NPM_CONFIG_PREFIX/bin:$PATH"
|
||||
export PATH="$HOME/.local/bin:$NPM_CONFIG_PREFIX/bin:$PATH"
|
||||
if [ "${OPENCLAW_DOCKER_AUTH_PRESTAGED:-0}" != "1" ]; then
|
||||
IFS=',' read -r -a auth_dirs <<<"${OPENCLAW_DOCKER_AUTH_DIRS_RESOLVED:-}"
|
||||
IFS=',' read -r -a auth_files <<<"${OPENCLAW_DOCKER_AUTH_FILES_RESOLVED:-}"
|
||||
@@ -153,6 +155,17 @@ WRAP
|
||||
npm install -g @openai/codex
|
||||
fi
|
||||
;;
|
||||
droid)
|
||||
if ! command -v droid >/dev/null 2>&1; then
|
||||
curl -fsSL https://app.factory.ai/cli | sh
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
fi
|
||||
droid --version
|
||||
if [ -z "${FACTORY_API_KEY:-}" ]; then
|
||||
echo "Droid Docker ACP bind requires FACTORY_API_KEY; Factory OAuth/keyring auth in ~/.factory is not portable into the container." >&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
gemini)
|
||||
mkdir -p "$HOME/.gemini"
|
||||
if [ ! -x "$NPM_CONFIG_PREFIX/bin/gemini" ]; then
|
||||
@@ -197,7 +210,7 @@ for token in "${ACP_AGENT_TOKENS[@]}"; do
|
||||
done
|
||||
|
||||
if ((${#ACP_AGENTS[@]} == 0)); then
|
||||
echo "No ACP bind agents selected. Use OPENCLAW_LIVE_ACP_BIND_AGENTS=claude,codex,gemini,opencode." >&2
|
||||
echo "No ACP bind agents selected. Use OPENCLAW_LIVE_ACP_BIND_AGENTS=claude,codex,droid,gemini,opencode." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -283,6 +296,7 @@ for ACP_AGENT in "${ACP_AGENTS[@]}"; do
|
||||
-e OPENCLAW_LIVE_ACP_BIND_ANTHROPIC_API_KEY_OLD="${ANTHROPIC_API_KEY_OLD:-}" \
|
||||
-e GEMINI_API_KEY \
|
||||
-e GOOGLE_API_KEY \
|
||||
-e FACTORY_API_KEY \
|
||||
-e OPENAI_API_KEY \
|
||||
-e OPENCODE_API_KEY \
|
||||
-e OPENCODE_ZEN_API_KEY \
|
||||
|
||||
Reference in New Issue
Block a user