Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/pyob/autoreviewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,17 @@ def get_valid_edit(

if not available_keys:
if is_cloud:
# Check if we've been stuck for a while
logger.warning(
"☁️ Cloud environment: Gemini keys exhausted/limited. Sleeping 60s for refill..."
"☁️ Cloud environment: Keys exhausted. Checking if cooldowns can be cleared..."
)

# FORCE RESET: If we are in the cloud and all keys are dead,
# we must clear the cooldowns to attempt a retry,
# otherwise the pipeline is effectively dead.
for key in self.key_cooldowns:
self.key_cooldowns[key] = 0.0

time.sleep(60)
attempts += 1
continue
Expand Down
2 changes: 1 addition & 1 deletion src/pyob/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def get_valid_llm_response_engine(

if not response_text or response_text.startswith("ERROR_CODE_"):
if key and response_text and "429" in response_text:
key_cooldowns[key] = time.time() + 1200
key_cooldowns[key] = time.time() + 60
logger.warning(f"⚠️ Key {key[-4:]} rate-limited. Rotating...")
if is_cloud:
logger.warning(
Expand Down
Loading