fix: stop gracefully with resume hint on persistent RateLimitError (#261) (#593)

This commit is contained in:
Rome Thorstenson
2026-06-29 07:31:54 -07:00
committed by GitHub
parent 8cdf0683a3
commit 777005a42b
2 changed files with 98 additions and 0 deletions
+14
View File
@@ -11,6 +11,7 @@ from typing import TYPE_CHECKING, Any
from agents import RunConfig
from agents.sandbox import SandboxRunConfig
from openai import RateLimitError
from strix.agents.factory import build_strix_agent, make_child_factory
from strix.config import load_settings
@@ -308,6 +309,19 @@ async def run_strix_scan(
with contextlib.suppress(Exception):
await coordinator.set_status(root_id, "stopped")
return None
except RateLimitError as exc:
logger.warning(
"Scan %s stopped: persistent rate limit from the LLM provider (%s). "
"Resume with 'strix --resume %s' once the limit clears.",
scan_id,
exc,
scan_id,
)
if root_id is not None:
await coordinator.cancel_descendants(root_id)
with contextlib.suppress(Exception):
await coordinator.set_status(root_id, "stopped")
return None
except BaseException:
logger.exception("Strix scan %s failed", scan_id)
if root_id is not None: