fix(gateway): guard against None request_overrides in _build_api_kwargs
This commit is contained in:
@@ -118,7 +118,7 @@ def test_turn_route_skips_priority_processing_for_unsupported_models():
|
||||
|
||||
route = gateway_run.GatewayRunner._resolve_turn_agent_config(runner, "hi", "gpt-5.3-codex", runtime_kwargs)
|
||||
|
||||
assert route["request_overrides"] is None
|
||||
assert route["request_overrides"] == {}
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
@@ -251,6 +251,14 @@ class TestBuildApiKwargsChatCompletionsServiceTier:
|
||||
kwargs = agent._build_api_kwargs(messages)
|
||||
assert "service_tier" not in kwargs
|
||||
|
||||
def test_no_crash_when_request_overrides_is_none(self, monkeypatch):
|
||||
agent = _make_agent(monkeypatch, "openrouter")
|
||||
agent.model = "gpt-4.1"
|
||||
agent.request_overrides = None
|
||||
messages = [{"role": "user", "content": "hi"}]
|
||||
kwargs = agent._build_api_kwargs(messages)
|
||||
assert "service_tier" not in kwargs
|
||||
|
||||
|
||||
class TestBuildApiKwargsKimiNoTemperatureOverride:
|
||||
def test_kimi_for_coding_omits_temperature(self, monkeypatch):
|
||||
|
||||
Reference in New Issue
Block a user