From 584afaaf6c6004af68bccdb30877cafaa2786852 Mon Sep 17 00:00:00 2001 From: Elron Bandel Date: Sun, 5 Jul 2026 21:40:32 +0300 Subject: [PATCH] fix(gateway): render config with POSIX sed instead of envsubst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit envsubst is a gateway dependency, but the standalone got it from the benchmark base — so benchmarks on their own base (aider-polyglot, ...) and 3 on external bases (terminal-bench/skills-bench/swe-lancer) had broken standalones (~June-28 regression). Render the config with POSIX sed in the bifrost + litellm start scripts (portkey uses printf) — any userland, no gettext, no per-benchmark package. Refs #257. Signed-off-by: Elron Bandel --- containers/core/standalone.Dockerfile | 3 --- containers/gateways/bifrost/start | 8 +++++--- containers/gateways/litellm/start | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/containers/core/standalone.Dockerfile b/containers/core/standalone.Dockerfile index b07c657f..97e81563 100644 --- a/containers/core/standalone.Dockerfile +++ b/containers/core/standalone.Dockerfile @@ -54,9 +54,6 @@ FROM eval-base # ─── Gateway layer (uniform /opt/gateway/ contract) ────────────────── COPY --from=model /opt/gateway /opt/gateway -# The gateway's start script needs envsubst (gettext-base) + curl at runtime; -# both now ship in the benchmark base, so this layer stays pure COPY — no -# per-combo apt (that emulated install under QEMU was the combo-build bottleneck). # ─── OTel collector layer ──────────────────────────────────────────── COPY --from=otel /otelcol /usr/local/bin/otelcol diff --git a/containers/gateways/bifrost/start b/containers/gateways/bifrost/start index 18ece0ad..843b9211 100644 --- a/containers/gateways/bifrost/start +++ b/containers/gateways/bifrost/start @@ -49,9 +49,11 @@ if [ -f "$TEMPLATE" ]; then OTEL_COLLECTOR_URL="${OTEL_EXPORTER_OTLP_ENDPOINT%/}/v1/traces" export OTEL_COLLECTOR_URL - # Explicit var list so envsubst leaves bifrost's own $schema key alone. - envsubst '${PROVIDER} ${MODEL_NAME} ${OPENAI_API_BASE} ${OTEL_COLLECTOR_URL}' \ - < "$TEMPLATE" > "$CONFIG" + sed -e "s|\${PROVIDER}|${PROVIDER-}|g" \ + -e "s|\${MODEL_NAME}|${MODEL_NAME-}|g" \ + -e "s|\${OPENAI_API_BASE}|${OPENAI_API_BASE-}|g" \ + -e "s|\${OTEL_COLLECTOR_URL}|${OTEL_COLLECTOR_URL-}|g" \ + < "$TEMPLATE" > "$CONFIG" fi exec /opt/gateway/main \ diff --git a/containers/gateways/litellm/start b/containers/gateways/litellm/start index 08444eba..42361805 100644 --- a/containers/gateways/litellm/start +++ b/containers/gateways/litellm/start @@ -27,7 +27,7 @@ CONFIG=/opt/gateway/config.yaml if [ -f "$TEMPLATE" ]; then : "${EVAL_MODEL:?EVAL_MODEL must be set to /}" - envsubst '${EVAL_MODEL}' < "$TEMPLATE" > "$CONFIG" + sed -e "s|\${EVAL_MODEL}|$EVAL_MODEL|g" < "$TEMPLATE" > "$CONFIG" fi # Caddy in background — listens on $PORT, forwards to litellm:4001.