Skip to content
Open
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
1 change: 1 addition & 0 deletions src/proxy_app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ async def process_credential(provider: str, path: str, provider_instance):

os.environ["LITELLM_LOG"] = "ERROR"
litellm.set_verbose = False
litellm.suppress_debug_info = True
litellm.drop_params = True
if USE_EMBEDDING_BATCHER:
batcher = EmbeddingBatcher(client=client)
Expand Down
32 changes: 28 additions & 4 deletions src/rotator_library/providers/gemini_cli_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -1530,12 +1530,36 @@ async def stream_handler():
if response.status_code >= 400:
try:
error_body = await response.aread()
lib_logger.error(
f"Gemini CLI API error {response.status_code}: {error_body.decode()}"
)
error_text = error_body.decode()
# Always log full body to transaction file for debugging
file_logger.log_error(
f"API error {response.status_code}: {error_body.decode()}"
f"API error {response.status_code}: {error_text}"
)
# Console logging: condensed for 429s, full for other errors
if response.status_code == 429:
# Extract key fields for a single-line summary
try:
err_json = json.loads(error_text)
err_msg = err_json.get("error", {}).get("message", "")
# Extract quotaResetDelay from details
reset_delay = ""
for detail in err_json.get("error", {}).get("details", []):
metadata = detail.get("metadata", {})
if "quotaResetDelay" in metadata:
reset_delay = metadata["quotaResetDelay"]
break
summary = f"Gemini CLI 429: {err_msg}"
if reset_delay:
summary += f" (resetDelay: {reset_delay})"
lib_logger.warning(summary)
except (json.JSONDecodeError, KeyError):
lib_logger.warning(
f"Gemini CLI 429: {error_text[:200]}"
)
else:
lib_logger.error(
f"Gemini CLI API error {response.status_code}: {error_text}"
)
except Exception:
pass

Expand Down
Loading