Co-authored-by: Brice Carpentier <brice.carpentier@mistral.ai>
Co-authored-by: Clément Drouin <clement.drouin@mistral.ai>
Co-authored-by: Clément Sirieix <clement.sirieix@mistral.ai>
Co-authored-by: Kim-Adeline Miguel <51720070+kimadeline@users.noreply.github.com>
Co-authored-by: Lucas Marandat <31749711+lucasmrdt@users.noreply.github.com>
Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com>
Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai>
Co-authored-by: Quentin <quentin.torroba@mistral.ai>
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Mathias Gesbert 2026-04-29 17:20:27 +02:00 committed by GitHub
parent 632ea8c032
commit 1fd7eea289
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
63 changed files with 3482 additions and 301 deletions

View file

@ -400,3 +400,28 @@ async def test_generic_provider_has_no_metadata_header() -> None:
headers = backend.requests_extra_headers[0]
assert headers is not None
assert "metadata" not in headers
@pytest.mark.asyncio
async def test_provider_extra_headers_are_forwarded() -> None:
backend = FakeBackend([mock_llm_chunk(content="Response")])
providers = [
ProviderConfig(
name="custom",
api_base="https://custom.example.com/v1",
extra_headers={"X-Custom-Auth": "token123", "X-Org-Id": "org-456"},
)
]
models = [ModelConfig(name="test-model", provider="custom", alias="test")]
config = build_test_vibe_config(
active_model="test", models=models, providers=providers
)
agent = build_test_agent_loop(config=config, backend=backend)
[_ async for _ in agent.act("Hello")]
assert len(backend.requests_extra_headers) == 1
headers = backend.requests_extra_headers[0]
assert headers is not None
assert headers["X-Custom-Auth"] == "token123"
assert headers["X-Org-Id"] == "org-456"