Download test_cli_timeout.py from lhc-lab/AI-Colab: direct link, hf CLI and curl.
- Browser
- Download file 400 Bytes
-
https://huggingface.co/datasets/lhc-lab/AI-Colab/resolve/main/test_cli_timeout.py
- Command line
-
hf download hf://datasets/lhc-lab/AI-Colab/test_cli_timeout.py
-
curl -L -o test_cli_timeout.py https://huggingface.co/datasets/lhc-lab/AI-Colab/resolve/main/test_cli_timeout.py
400 Bytes
| import asyncio | |
| from core.gemini_cli_executor import execute | |
| async def test(): | |
| # Заведомо малый таймаут | |
| resp = await execute(mode="console", message="x" * 5000, timeout=1) | |
| assert "таймаут" in resp.lower() or "ошибка" in resp.lower(), f"Нет fallback: {resp}" | |
| print("✅ TIMEOUT HANDLED: fallback returned safely") | |
| return True | |
| asyncio.run(test()) | |