core/cli: soft-fail GET /models cancel/timeout on provider switch

Map CancelledError and TimeoutError from models() to RuntimeError so
merged_model_choices falls back to config/cache. Stub remote fetch in
/provider unit tests so they never hit the network.
This commit is contained in:
2026-07-19 22:38:22 +08:00
parent 58ff646034
commit aadcd237db
4 changed files with 35 additions and 7 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ async def test_fetch_remote_model_ids_timeout() -> None:
await asyncio.sleep(10)
return ["late"]
with pytest.raises(TimeoutError):
with pytest.raises(RuntimeError, match="timed out"):
_ = await fetch_remote_model_ids(Slow(), timeout_seconds=0.05)