diff --git a/tests/test_issue1855_resolve_model_provider_fast_path.py b/tests/test_issue1855_resolve_model_provider_fast_path.py index 4e91256ce..f9c3b65fe 100644 --- a/tests/test_issue1855_resolve_model_provider_fast_path.py +++ b/tests/test_issue1855_resolve_model_provider_fast_path.py @@ -269,7 +269,12 @@ class TestFastPathSourceShape: """The fast-path return must come BEFORE the catalog lookup.""" src = _read("api/routes.py") idx = src.find("def _resolve_compatible_session_model_state(") - body = src[idx:idx + 6000] + # Helper grew (profile_config, custom repair); 6k window no longer reaches + # the slow-path catalog call — use a bounded slice through the next def. + body = src[idx:idx + 12000] + next_def = body.find("\ndef ", 100) + if next_def != -1: + body = body[:next_def] fast_path_idx = body.find("if model and requested_provider:") catalog_idx = body.find("catalog = get_available_models()") assert fast_path_idx != -1 and catalog_idx != -1 diff --git a/tests/test_start_session_turn_runtime_adapter.py b/tests/test_start_session_turn_runtime_adapter.py index b0f0c76c0..35b56ef4f 100644 --- a/tests/test_start_session_turn_runtime_adapter.py +++ b/tests/test_start_session_turn_runtime_adapter.py @@ -50,7 +50,7 @@ def _stub_routes(monkeypatch): monkeypatch.setattr( routes_mod, "_resolve_compatible_session_model_state", - lambda model, provider, profile_provider=None, profile_default_model=None, prefer_cached_catalog=False: (model, provider, model), + lambda model, provider, **kwargs: (model, provider, model), ) # 4. Block the per-session live-view fan-out (it pokes a real registry). diff --git a/tests/test_wakeup_model_resolve_hang.py b/tests/test_wakeup_model_resolve_hang.py index 0263d54da..9da26b983 100644 --- a/tests/test_wakeup_model_resolve_hang.py +++ b/tests/test_wakeup_model_resolve_hang.py @@ -123,13 +123,15 @@ def test_wakeup_resolve_passes_prefer_cached_catalog(monkeypatch): real = routes._resolve_compatible_session_model_state def _spy(model_id, model_provider=None, *, profile_provider=None, - profile_default_model=None, prefer_cached_catalog=False): + profile_default_model=None, profile_config=None, + prefer_cached_catalog=False, **kwargs): seen["prefer_cached_catalog"] = prefer_cached_catalog # The wakeup path now also threads the session's profile model defaults # through (greptile fix) so a brand-new session with an empty model # falls back to the profile default, not the global DEFAULT_MODEL. seen["profile_provider"] = profile_provider seen["profile_default_model"] = profile_default_model + seen["profile_config"] = profile_config return ("m", None, False) monkeypatch.setattr(