Skip to content

Open-source AI coworkers that each get a computer of their own: a browser, files and tools, with every action decided before it happens and recorded after. Bring any AG-UI agent.

Keep the chosen provider on a model name that contains a slash (#617)

kevin86ec5714f9cd
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index cbd8bf68..c126544d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -311,6 +311,13 @@ jobs:
. .venv-agno/bin/activate
python -m pip install --requirement agent-agno/requirements.txt --requirement agent-agno/requirements-test.txt
python -m pytest agent-agno/tests -q
+ - name: Strands model-choice regression
+ run: |
+ set -euo pipefail
+ python -m venv .venv-strands
+ . .venv-strands/bin/activate
+ python -m pip install --requirement agent-strands/requirements.txt --requirement agent-strands/requirements-test.txt
+ python -m pytest agent-strands/tests -q
- name: Pydantic AI model-choice regression
run: |
set -euo pipefail
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3f1d5915..13d89a44 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,6 +18,15 @@ the trail saying so. The grant is now refused, naming the app. Taking a grant aw
a dead row an administrator can see is still one they can remove, and a tool a connector has stopped
advertising can still be granted: what a vendor lists today is not what somebody decided yesterday.
+### The LiteLLM Bots keep the chosen provider on a model name that contains a slash
+
+A model name the endpoint publishes with a slash in it — `qwen/qwen3-8b`, or the docs example
+`openai/gpt-5.6-terra` — was treated as already carrying a provider. LiteLLM then took the first
+half as the provider and sent only the rest, so a compatibility endpoint either failed with
+`LLM Provider NOT provided` or received `gpt-5.6-terra` instead of the namespaced name. The ADK,
+Strands, Agno, LlamaIndex and CrewAI Bots now keep the chosen provider in front, and the whole
+model name reaches the endpoint.
+
### A Google Drive shortcut is read as the file it points at
Search and recent files return shortcuts as ordinary hits, and reading one by that id was refused
@@ -32,6 +41,12 @@ A tool that declares an output schema often puts the answer in `structuredConten
content list empty. That empty list was reported as "nothing was found", so the model filled the
gap from memory while the vendor had answered. The structured object is now read when the content
list had nothing to say. A tool that already sent text is unchanged.
+The slash no longer names the provider on those five Bots, so a `BOT_MODEL` that relied on it to
+reach somewhere other than `BOT_PROVIDER` is now read as part of the model name: `bedrock/…`,
+`azure/…` and `openrouter/…` reach the provider `BOT_PROVIDER` names rather than the one written in
+front of the slash. `BOT_PROVIDER` is the setting for that, and a model name written bare beside it
+behaves as it did. The framework Bot `agent-langgraph` and the Langroid Bot are unchanged, because
+neither read the slash that way.
### A coworker can be a file of its own
diff --git a/agent-adk/src/main.py b/agent-adk/src/main.py
index 33b65997..eb6436a7 100644
--- a/agent-adk/src/main.py
+++ b/agent-adk/src/main.py
@@ -16,9 +16,19 @@ TOKEN_HEADER = "x-openbot-agent-token"
def _model_id() -> str:
+ """`provider/model`, which is how litellm addresses one.
+
+ The model half is whatever the endpoint publishes, slashes included. litellm takes the first
+ path component as the provider and sends the rest as the model name, so a name that already
+ contains a slash still needs the chosen provider in front: `qwen/qwen3-8b` on an
+ OpenAI-compatible endpoint is `openai/qwen/qwen3-8b`, and `openai/gpt-5.6-terra` is
+ `openai/openai/gpt-5.6-terra`. Treating a slash as "already a provider" dropped the prefix,
+ and litellm then either routed to a provider nobody configured (`LLM Provider NOT provided`)
+ or sent only the second half to the endpoint.
+ """
provider = (os.environ.get("BOT_PROVIDER") or "openai").strip()
model = (os.environ.get("BOT_MODEL") or "gpt-4o-mini").strip()
- return model if "/" in model else f"{provider}/{model}"
+ return f"{provider}/{model}"
app = FastAPI()
diff --git a/agent-adk/tests/test_main.py b/agent-adk/tests/test_main.py
index 2bd70092..4be11e04 100644
--- a/agent-adk/tests/test_main.py
+++ b/agent-adk/tests/test_main.py
@@ -160,6 +160,46 @@ def test_client_tool_executes_and_its_result_reaches_the_followup_model(harness)
assert answer == TOOL_VALUE
[email protected]("model", ["qwen/qwen3-8b", "openai/gpt-5.6-terra"])
+def test_a_namespaced_model_name_is_sent_to_the_endpoint(monkeypatch, provider, model):
+ """The whole name the endpoint publishes, including a slash, has to reach it."""
+ base_url, seen = provider
+ for name, value in {
+ "OPENAI_API_KEY": "synthetic-test-key",
+ "OPENAI_BASE_URL": base_url,
+ "BOT_PROVIDER": "openai",
+ "BOT_MODEL": model,
+ "MANAGED_AGENT_TOKEN": TOKEN,
+ "OTEL_SDK_DISABLED": "true",
+ }.items():
+ monkeypatch.setenv(name, value)
+ monkeypatch.delenv("OPENAI_API_BASE", raising=False)
+ from src import main
+
+ app = importlib.reload(main).app
+
+ async def roundtrip():
+ body = {
+ "threadId": "namespaced-model",
+ "runId": "first-run",
+ "state": {},
+ "context": [],
+ "forwardedProps": {},
+ "messages": [{"id": "user", "role": "user", "content": "Say hello."}],
+ "tools": [],
+ }
+ async with httpx.AsyncClient(
+ transport=httpx.ASGITransport(app=app), base_url="http://harness"
+ ) as client:
+ return decode(
+ await client.post("/", headers={"x-openbot-agent-token": TOKEN}, json=body)
+ )
+
+ asyncio.run(asyncio.wait_for(roundtrip(), timeout=30))
+ assert seen, "the endpoint was never asked"
+ assert seen[0][2]["model"] == model
+
+
@pytest.mark.parametrize("headers", [{}, {"x-openbot-agent-token": "wrong-token"}])
def test_client_tools_still_require_the_server_token(harness, headers):
app, seen = harness
diff --git a/agent-agno/src/main.py b/agent-agno/src/main.py
index e52db4b4..ed8b6e10 100644
--- a/agent-agno/src/main.py
+++ b/agent-agno/src/main.py
@@ -19,10 +19,19 @@ TOKEN_HEADER = "x-openbot-agent-token"
def _model_id() -> str:
- """`provider/model`, which is how litellm addresses one and how OpenBot stores the choice."""
+ """`provider/model`, which is how litellm addresses one and how OpenBot stores the choice.
+
+ The model half is whatever the endpoint publishes, slashes included. litellm takes the first
+ path component as the provider and sends the rest as the model name, so a name that already
+ contains a slash still needs the chosen provider in front: `qwen/qwen3-8b` on an
+ OpenAI-compatible endpoint is `openai/qwen/qwen3-8b`, and `openai/gpt-5.6-terra` is
+ `openai/openai/gpt-5.6-terra`. Treating a slash as "already a provider" dropped the prefix,
+ and litellm then either routed to a provider nobody configured (`LLM Provider NOT provided`)
+ or sent only the second half to the endpoint.
+ """
provider = (os.environ.get("BOT_PROVIDER") or "openai").strip()
model = (os.environ.get("BOT_MODEL") or "gpt-5.5").strip()
- return model if "/" in model else f"{provider}/{model}"
+ return f"{provider}/{model}"
agent = Agent(
diff --git a/agent-agno/tests/test_main.py b/agent-agno/tests/test_main.py
index dcf7e22d..201b80a9 100644
--- a/agent-agno/tests/test_main.py
+++ b/agent-agno/tests/test_main.py
@@ -149,6 +149,28 @@ CHOICES = {
},
("openai", "local-model"),
),
+ # An endpoint that namespaces its catalogue. The whole name has to reach it; a slash is not a
+ # provider already being named.
+ "an OpenAI-compatible endpoint that namespaces its catalogue": (
+ lambda base: {
+ "BOT_PROVIDER": "",
+ "BOT_MODEL": "openai/gpt-5.6-terra",
+ "OPENAI_API_KEY": "no-key-needed",
+ "OPENAI_BASE_URL": f"{base}/v1",
+ "ANTHROPIC_API_KEY": "",
+ },
+ ("openai", "openai/gpt-5.6-terra"),
+ ),
+ "an OpenAI-compatible endpoint whose model name contains a slash": (
+ lambda base: {
+ "BOT_PROVIDER": "",
+ "BOT_MODEL": "qwen/qwen3-8b",
+ "OPENAI_API_KEY": "no-key-needed",
+ "OPENAI_BASE_URL": f"{base}/v1",
+ "ANTHROPIC_API_KEY": "",
+ },
+ ("openai", "qwen/qwen3-8b"),
+ ),
# The default: Compose passes `gpt-5.5` when the model screen names no model, and Agno sends a
# temperature and a `top_p` on every request, which LiteLLM refuses for that reasoning model.
"an OpenAI key": (
diff --git a/agent-crewai/src/main.py b/agent-crewai/src/main.py
index dbd80d13..ed62d700 100644
--- a/agent-crewai/src/main.py
+++ b/agent-crewai/src/main.py
@@ -37,10 +37,18 @@ def _model() -> str:
`BOT_PROVIDER` and `BOT_MODEL` are set by the shell from the model screen. litellm addresses a
model as `provider/model`, and it reads that provider's key from the environment itself, which
is why nothing here touches a key.
+
+ The model half is whatever the endpoint publishes, slashes included. litellm takes the first
+ path component as the provider and sends the rest as the model name, so a name that already
+ contains a slash still needs the chosen provider in front: `qwen/qwen3-8b` on an
+ OpenAI-compatible endpoint is `openai/qwen/qwen3-8b`, and `openai/gpt-5.6-terra` is
+ `openai/openai/gpt-5.6-terra`. Treating a slash as "already a provider" dropped the prefix,
+ and litellm then either routed to a provider nobody configured (`LLM Provider NOT provided`)
+ or sent only the second half to the endpoint.
"""
provider = (os.environ.get("BOT_PROVIDER") or "").strip() or "openai"
model = (os.environ.get("BOT_MODEL") or "").strip() or "gpt-5.5"
- return model if "/" in model else f"{provider}/{model}"
+ return f"{provider}/{model}"
_PROVIDER_MESSAGE_FIELDS = {
diff --git a/agent-crewai/tests/test_main.py b/agent-crewai/tests/test_main.py
index c1507fa0..a46d33fa 100644
--- a/agent-crewai/tests/test_main.py
+++ b/agent-crewai/tests/test_main.py
@@ -56,8 +56,10 @@ def run_input(messages):
("openai", " ", "openai/gpt-5.5"),
("anthropic", "claude-3-5-sonnet-latest", "anthropic/claude-3-5-sonnet-latest"),
("custom-provider", "custom-model", "custom-provider/custom-model"),
- (" ", "azure/gpt-4o", "azure/gpt-4o"),
- ("anthropic", "openai/gpt-4o", "openai/gpt-4o"),
+ (" ", "azure/gpt-4o", "openai/azure/gpt-4o"),
+ ("anthropic", "openai/gpt-4o", "anthropic/openai/gpt-4o"),
+ ("openai", "qwen/qwen3-8b", "openai/qwen/qwen3-8b"),
+ ("", "openai/gpt-5.6-terra", "openai/openai/gpt-5.6-terra"),
],
)
def test_model_normalizes_blank_provider_and_model_before_defaults(
@@ -462,6 +464,18 @@ def run_litellm_loopback_proof(proof_case, output):
"blank-model": ("openai", " ", "openai/gpt-5.5", "gpt-5.5"),
"strict-projection": ("openai", "gpt-4o", "openai/gpt-4o", "gpt-4o"),
"caller-tool": ("openai", "gpt-4o", "openai/gpt-4o", "gpt-4o"),
+ "namespaced-model": (
+ "openai",
+ "qwen/qwen3-8b",
+ "openai/qwen/qwen3-8b",
+ "qwen/qwen3-8b",
+ ),
+ "gateway-model": (
+ "openai",
+ "openai/gpt-5.6-terra",
+ "openai/openai/gpt-5.6-terra",
+ "openai/gpt-5.6-terra",
+ ),
}[proof_case]
os.environ["BOT_PROVIDER"] = provider
os.environ["BOT_MODEL"] = model
@@ -715,7 +729,10 @@ def assert_provider_messages_are_projected(messages):
assert tool_call["id"] == "call-1"
[email protected]("proof_case", ["blank-provider", "blank-model", "strict-projection"])
+ "proof_case",
+ ["blank-provider", "blank-model", "strict-projection", "namespaced-model", "gateway-model"],
+)
def test_crewai_endpoint_uses_normalized_model_with_real_litellm_loopback(
tmp_path, proof_case
):
@@ -762,7 +779,14 @@ if __name__ == "__main__":
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
"--proof-case",
- choices=["blank-provider", "blank-model", "strict-projection", "caller-tool"],
+ choices=[
+ "blank-provider",
+ "blank-model",
+ "strict-projection",
+ "caller-tool",
+ "namespaced-model",
+ "gateway-model",
+ ],
required=True,
)
parser.add_argument("--output", type=Path, required=True)
diff --git a/agent-llamaindex/src/main.py b/agent-llamaindex/src/main.py
index 02601645..4870bcd7 100644
--- a/agent-llamaindex/src/main.py
+++ b/agent-llamaindex/src/main.py
@@ -16,9 +16,19 @@ TOKEN_HEADER = "x-openbot-agent-token"
def _model_id() -> str:
+ """`provider/model`, which is how litellm addresses one.
+
+ The model half is whatever the endpoint publishes, slashes included. litellm takes the first
+ path component as the provider and sends the rest as the model name, so a name that already
+ contains a slash still needs the chosen provider in front: `qwen/qwen3-8b` on an
+ OpenAI-compatible endpoint is `openai/qwen/qwen3-8b`, and `openai/gpt-5.6-terra` is
+ `openai/openai/gpt-5.6-terra`. Treating a slash as "already a provider" dropped the prefix,
+ and litellm then either routed to a provider nobody configured (`LLM Provider NOT provided`)
+ or sent only the second half to the endpoint.
+ """
provider = (os.environ.get("BOT_PROVIDER") or "openai").strip()
model = (os.environ.get("BOT_MODEL") or "gpt-5.5").strip()
- return model if "/" in model else f"{provider}/{model}"
+ return f"{provider}/{model}"
def _llm() -> LiteLLM:
diff --git a/agent-llamaindex/tests/test_main.py b/agent-llamaindex/tests/test_main.py
index c357332f..1e701bd2 100644
--- a/agent-llamaindex/tests/test_main.py
+++ b/agent-llamaindex/tests/test_main.py
@@ -149,6 +149,28 @@ CHOICES = {
},
("openai", "local-model"),
),
+ # An endpoint that namespaces its catalogue. The whole name has to reach it; a slash is not a
+ # provider already being named.
+ "an OpenAI-compatible endpoint that namespaces its catalogue": (
+ lambda base: {
+ "BOT_PROVIDER": "",
+ "BOT_MODEL": "openai/gpt-5.6-terra",
+ "OPENAI_API_KEY": "no-key-needed",
+ "OPENAI_BASE_URL": f"{base}/v1",
+ "ANTHROPIC_API_KEY": "",
+ },
+ ("openai", "openai/gpt-5.6-terra"),
+ ),
+ "an OpenAI-compatible endpoint whose model name contains a slash": (
+ lambda base: {
+ "BOT_PROVIDER": "",
+ "BOT_MODEL": "qwen/qwen3-8b",
+ "OPENAI_API_KEY": "no-key-needed",
+ "OPENAI_BASE_URL": f"{base}/v1",
+ "ANTHROPIC_API_KEY": "",
+ },
+ ("openai", "qwen/qwen3-8b"),
+ ),
"an OpenAI key": (
lambda base: {
"BOT_PROVIDER": "",
diff --git a/agent-strands/requirements-test.txt b/agent-strands/requirements-test.txt
new file mode 100644
index 00000000..a91d60c6
--- /dev/null
+++ b/agent-strands/requirements-test.txt
@@ -0,0 +1,2 @@
+httpx==0.28.1
+pytest==9.0.2
diff --git a/agent-strands/src/main.py b/agent-strands/src/main.py
index bafa22ed..46275c23 100644
--- a/agent-strands/src/main.py
+++ b/agent-strands/src/main.py
@@ -10,9 +10,19 @@ from strands.models.litellm import LiteLLMModel
def _model_id() -> str:
+ """`provider/model`, which is how litellm addresses one.
+
+ The model half is whatever the endpoint publishes, slashes included. litellm takes the first
+ path component as the provider and sends the rest as the model name, so a name that already
+ contains a slash still needs the chosen provider in front: `qwen/qwen3-8b` on an
+ OpenAI-compatible endpoint is `openai/qwen/qwen3-8b`, and `openai/gpt-5.6-terra` is
+ `openai/openai/gpt-5.6-terra`. Treating a slash as "already a provider" dropped the prefix,
+ and litellm then either routed to a provider nobody configured (`LLM Provider NOT provided`)
+ or sent only the second half to the endpoint.
+ """
provider = (os.environ.get("BOT_PROVIDER") or "openai").strip()
model = (os.environ.get("BOT_MODEL") or "gpt-4o-mini").strip()
- return model if "/" in model else f"{provider}/{model}"
+ return f"{provider}/{model}"
app = FastAPI()
diff --git a/agent-strands/tests/test_main.py b/agent-strands/tests/test_main.py
new file mode 100644
index 00000000..a6fa792a
--- /dev/null
+++ b/agent-strands/tests/test_main.py
@@ -0,0 +1,168 @@
+import importlib
+import json
+import socket
+import sys
+import threading
+import time
+from pathlib import Path
+
+import pytest
+import uvicorn
+from fastapi import FastAPI, Request
+from fastapi.responses import JSONResponse, StreamingResponse
+from fastapi.testclient import TestClient
+
+sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
+
+TOKEN = "test-token"
+RUN = {
+ "threadId": "thread-1",
+ "runId": "run-1",
+ "state": {},
+ "messages": [{"id": "m1", "role": "user", "content": "Say hello"}],
+ "tools": [],
+ "context": [],
+ "forwardedProps": {},
+}
+
+
+def _sse(events):
+ async def stream():
+ for event in events:
+ yield event
+
+ return StreamingResponse(stream(), media_type="text/event-stream")
+
+
+def _provider_app(seen):
+ app = FastAPI()
+
+ @app.post("/v1/chat/completions")
+ async def openai_chat(request: Request):
+ body = await request.json()
+ seen.append(("openai", body["model"]))
+ if not body.get("stream"):
+ return JSONResponse(
+ {
+ "id": "c",
+ "object": "chat.completion",
+ "created": 0,
+ "model": body["model"],
+ "choices": [
+ {
+ "index": 0,
+ "finish_reason": "stop",
+ "message": {"role": "assistant", "content": "hello"},
+ }
+ ],
+ }
+ )
+ chunk = {
+ "id": "c",
+ "object": "chat.completion.chunk",
+ "created": 0,
+ "model": body["model"],
+ "choices": [
+ {
+ "index": 0,
+ "delta": {"role": "assistant", "content": "hello"},
+ "finish_reason": None,
+ }
+ ],
+ }
+ done = {**chunk, "choices": [{"index": 0, "delta": {}, "finish_reason": "stop"}]}
+ return _sse(
+ [f"data: {json.dumps(chunk)}\n\n", f"data: {json.dumps(done)}\n\n", "data: [DONE]\n\n"]
+ )
+
+ return app
+
+
+def provider():
+ seen = []
+ with socket.socket() as probe:
+ probe.bind(("127.0.0.1", 0))
+ port = probe.getsockname()[1]
+ server = uvicorn.Server(
+ uvicorn.Config(_provider_app(seen), host="127.0.0.1", port=port, log_level="error")
+ )
+ thread = threading.Thread(target=server.run, daemon=True)
+ thread.start()
+ deadline = time.monotonic() + 10
+ while not server.started and time.monotonic() < deadline:
+ time.sleep(0.01)
+ yield f"http://127.0.0.1:{port}", seen
+ server.should_exit = True
+ thread.join(timeout=10)
+
+
+ ("bot_provider", "model", "expected"),
+ [
+ ("openai", "gpt-4o-mini", "openai/gpt-4o-mini"),
+ ("openai", "qwen/qwen3-8b", "openai/qwen/qwen3-8b"),
+ ("openai", "openai/gpt-5.6-terra", "openai/openai/gpt-5.6-terra"),
+ ("", "qwen/qwen3-8b", "openai/qwen/qwen3-8b"),
+ ("anthropic", "claude-sonnet-4-5", "anthropic/claude-sonnet-4-5"),
+ ],
+)
+def test_model_id_keeps_the_chosen_provider_on_a_name_that_contains_a_slash(
+ monkeypatch, bot_provider, model, expected
+):
+ monkeypatch.setenv("BOT_PROVIDER", bot_provider)
+ monkeypatch.setenv("BOT_MODEL", model)
+ monkeypatch.setenv("MANAGED_AGENT_TOKEN", TOKEN)
+ monkeypatch.setenv("OPENAI_API_KEY", "no-key-needed")
+ monkeypatch.delenv("OPENAI_API_BASE", raising=False)
+
+ from src import main
+
+ main = importlib.reload(main)
+ assert main._model_id() == expected
+
+
+CHOICES = {
+ "an OpenAI-compatible endpoint that namespaces its catalogue": (
+ lambda base: {
+ "BOT_PROVIDER": "",
+ "BOT_MODEL": "openai/gpt-5.6-terra",
+ "OPENAI_API_KEY": "no-key-needed",
+ "OPENAI_BASE_URL": f"{base}/v1",
+ "ANTHROPIC_API_KEY": "",
+ },
+ ("openai", "openai/gpt-5.6-terra"),
+ ),
+ "an OpenAI-compatible endpoint whose model name contains a slash": (
+ lambda base: {
+ "BOT_PROVIDER": "",
+ "BOT_MODEL": "qwen/qwen3-8b",
+ "OPENAI_API_KEY": "no-key-needed",
+ "OPENAI_BASE_URL": f"{base}/v1",
+ "ANTHROPIC_API_KEY": "",
+ },
+ ("openai", "qwen/qwen3-8b"),
+ ),
+}
+
+
[email protected]("choice", list(CHOICES))
+def test_a_run_sends_a_namespaced_model_name_verbatim(monkeypatch, provider, choice):
+ base, seen = provider
+ environment, expected = CHOICES[choice]
+ monkeypatch.delenv("OPENAI_API_BASE", raising=False)
+ monkeypatch.setenv("MANAGED_AGENT_TOKEN", TOKEN)
+ for key, value in environment(base).items():
+ monkeypatch.setenv(key, value)
+
+ from src import main
+
+ main = importlib.reload(main)
+ response = TestClient(main.app).post(
+ "/", json=RUN, headers={"x-openbot-agent-token": TOKEN}
+ )
+
+ assert response.status_code == 200
+ assert '"RUN_FINISHED"' in response.text
+ assert '"RUN_ERROR"' not in response.text
+ assert seen == [expected]