Skip to content

AI-powered virtual executive team — a single coherent executive persona backed by 8 specialist agents (FastAPI + Next.js).

fix(deps): bake the tool-search model with the fastembed the gateway runs (#392)

Rufus96d5e3acd60e
diff --git a/docker/Dockerfile b/docker/Dockerfile
index c85a0a8a..9ceec8e6 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -86,7 +86,7 @@ COPY packages/core/pyproject.toml packages/core/uv.lock ./
# the system interpreter's prefix, so the packages land in system
# site-packages exactly as before: the model bakes below and the runtime CMD
# rely on that.
-# (The fastembed install further down is a separate, unpinned resolution into
+# (The fastembed install further down is a separate resolution into
# the same env; today it moves nothing because the locked versions already
# satisfy its constraints.)
RUN UV_PROJECT_ENVIRONMENT=/usr/local \
@@ -116,8 +116,14 @@ RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTr
# load the model from disk (offline, see HF_HUB_OFFLINE below) instead of the
# network. No `|| true`: if the bake can't fetch, fail the build rather than ship
# an image that silently re-downloads — the model is deterministic.
+# Pin the SAME fastembed the gateway's uvx env resolves under its
+# --exclude-newer cutoff (orchestrator/mcp_gateway.py), not a floating one: a
+# cache baked by fastembed 0.9.0 can't be loaded offline by 0.8.1, so when
+# 0.9.0 shipped the gateway hung at startup, timed out, and the
+# deployment came up with no MCP tools (Google included). Bump this together
+# with the cutoff.
ENV FASTEMBED_CACHE_PATH=/opt/fastembed-cache
-RUN uv pip install --system "fastembed>=0.6.0" \
+RUN uv pip install --system "fastembed==0.8.1" \
&& python -c "from fastembed import TextEmbedding; TextEmbedding('sentence-transformers/all-MiniLM-L6-v2')"
# Google Workspace MCP server, run co-located as a stdio child of the MCP gateway
diff --git a/packages/core/tests/unit/test_extensible_mcp_pin.py b/packages/core/tests/unit/test_extensible_mcp_pin.py
index 555b45a6..47896fc4 100644
--- a/packages/core/tests/unit/test_extensible_mcp_pin.py
+++ b/packages/core/tests/unit/test_extensible_mcp_pin.py
@@ -81,3 +81,28 @@ def test_dockerfile_prewarm_matches_the_gateway_launch() -> None:
f"{mcp_gateway._EXTENSIBLE_MCP_LAUNCH_ARGS}; the image would cache one set of packages "
"and resolve another at every start"
)
+
+
+# fastembed releases and their PyPI upload times. The gateway's uvx env runs
+# the newest one published before the cutoff; add a release here when you
+# move the cutoff past it.
+_FASTEMBED_RELEASES = {
+ "0.8.1": _FASTEMBED_0_8_1_PUBLISHED,
+ "0.9.0": "2026-10-07T16:38:49Z",
+}
+FASTEMBED_BAKE = re.compile(r'uv pip install --system "fastembed([^"]*)"')
+
+
+def test_dockerfile_bakes_the_model_with_the_runtime_fastembed() -> None:
+ args = mcp_gateway._EXTENSIBLE_MCP_LAUNCH_ARGS
+ cutoff = args[args.index("--exclude-newer") + 1]
+ runtime = max(
+ (v for v, published in _FASTEMBED_RELEASES.items() if published < cutoff),
+ key=lambda v: _FASTEMBED_RELEASES[v],
+ )
+ bakes = FASTEMBED_BAKE.findall(DOCKERFILE.read_text(encoding="utf-8"))
+ assert bakes == [f"=={runtime}"], (
+ f"docker/Dockerfile bakes the tool-search model with fastembed{bakes} but the gateway "
+ f"runs fastembed {runtime}; a cache baked by another version may not load offline, and "
+ "then the gateway times out at startup with no MCP tools"
+ )