start.sh:
- CLOUDFLARE_PROXY_DEBUG defaults to false (Gemini path verified working;
per-request "Redirecting" log is no longer needed by default).
- Replace shell-interpolated jq calls with --arg/--argjson for
GATEWAY_TOKEN, LLM_MODEL, OPENCLAW_PASSWORD, BROWSER_EXECUTABLE_PATH,
SPACE_HOST, TELEGRAM_USER_ID. Prevents JSON breakage and jq filter
injection if those values contain quotes/backslashes/dollar signs.
- Combine ~6 sequential jq invocations (token + model + logging,
plugin allow/deny + entry toggles, controlUi + password) into single
pipelines. Saves several hundred ms of subprocess overhead on cold start.
- Document why device-pair/phone-control/talk-voice are pre-allowed and
why lmstudio/xai PLUGINS (not the xai model provider) are denied.
- Replace `sleep 3 && kill -0 $!` readiness check with a TCP poll on
127.0.0.1:7860 (configurable via GATEWAY_READY_TIMEOUT, default 90s)
that also bails out if the pipeline died. Old check tested the tee PID
in the pipe…
- workspace-sync.py: set HF_HUB_VERBOSITY=error before huggingface_hub
import. The "No files have been modified..." spam is logger.warning
level inside upload_large_folder workers; setting Python logging
level after import didn't work because hub re-applies its own level
from the env var on import. Drop emoji prefixes from our own prints.
- cloudflare-proxy.js: switch banner dedupe from process.env to
/tmp/.cf-proxy-banner-shown file marker. Children spawn from bash
(not Node), so an env-var marker set by the parent Node doesn't
propagate. /tmp resets per container so the banner still shows once
per deploy.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Fix UND_ERR_INVALID_ARG by not spreading init into proxy fetch
Root cause: spreading `init` into the new fetch options carried over
`dispatcher`/`client` references that undici had pinned to the original
target host's connection pool. When we changed the URL to the CF Worker
but kept the original dispatcher, undici threw UND_ERR_INVALID_ARG
synchronously (~4ms, not a network error).
- cloudflare-proxy.js: build newInit explicitly with only well-known
fetch options (method, headers, body, signal, redirect, etc.) instead
of `...init`. Drop dispatcher/client/duplex from caller's init unless
body is a ReadableStream. Add init debug info to error log.
- cloudflare-proxy.js: dedupe startup banner across child Node procs
(NODE_OPTIONS=--require makes script run in every spawn).
- cloudflare-proxy.js: drop redundant "Host match" log (covered by
"Redirecting").
- workspace-sync.py: silence huggingface_hub WARNING-level chatter
("No files have been modified...") via logging config.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add proxy error cause logging, clean up startup logs
- cloudflare-proxy.js: add logProxyError() to log actual fetch failure
cause (error.cause.code/message) so Gemini errors are visible in logs;
fix DEBUG hardcode (|| true); only add duplex:half for ReadableStream
bodies; normalize proxiedUrl to string in all fetch paths
- start.sh: replace boxed config table with simple key:value lines
matching Hugging8n style; drop emoji noise from log lines; remove HF
token validation curl (was noisy and not critical path)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix: proxy googleapis.com through Cloudflare and fix fetch duplex for POST streaming
- Add googleapis.com to default CLOUDFLARE_PROXY_DOMAINS so Gemini API
calls route through CF Worker instead of going direct (HF blocks direct
connections to generativelanguage.googleapis.com)
- Fix duplex:"half" placement in patched fetch — must be a fetch() init
option not a Request constructor option; Node.js/undici only reads it
from fetch opts, causing POST streaming bodies to fail immediately
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>