Skip to content

Conversation

@DarshGupta123
Copy link
Contributor

No description provided.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Retry Logic Fails Due to String Parsing

The retry logic in PersonaService._make_request_with_retry is unreliable. It attempts to determine retryable HTTP errors by parsing status codes from PersonaError string messages. However, _make_request converts aiohttp.ClientResponseError into PersonaError with inconsistent string formats (e.g., "Rate limit exceeded" for 429, or generic "API error: {error_text}" for 5xx codes), losing the original status code. This brittle string matching can lead to incorrect retry decisions, including false positives or failures to retry.

pipeiq_framework/persona_client/persona_service.py#L436-L447

# Check if this is a wrapped HTTP error that we should retry
should_retry = False
# Extract status code if it's a rate limit or server error
if "Rate limit exceeded" in str(e):
should_retry = 429 in self.retry_config.retry_on_status_codes
elif "API error" in str(e) and any(code_str in str(e) for code_str in ["500", "502", "503", "504"]):
# Try to extract the actual status code from error message
for code in self.retry_config.retry_on_status_codes:
if str(code) in str(e):
should_retry = True
break

Fix in Cursor


Bug: RateLimiter Timestamp Update Error

The RateLimiter incorrectly updates its last_update timestamp. When a request is delayed due to insufficient tokens, last_update is set to the time before the asyncio.sleep() call. This causes subsequent token bucket calculations to be inaccurate, potentially over-crediting tokens and allowing the system to exceed the configured rate limit.

pipeiq_framework/persona_client/persona_service.py#L211-L213

self.tokens -= 1
self.last_update = now

Fix in Cursor


Bug: Custom Exception Conflicts with Built-in Class

The custom ConnectionError class shadows Python's built-in ConnectionError exception, leading to a naming collision. This causes confusion and potential misbehavior in error handling, as code expecting to catch the standard library's ConnectionError may incorrectly catch the custom one, or vice versa. The custom exception should be renamed (e.g., PersonaConnectionError) to resolve this conflict.

pipeiq_framework/persona_client/persona_service.py#L319-L322

class ConnectionError(PersonaError):
"""Raised when there's an error connecting to Persona."""
pass

Fix in Cursor


Was this report helpful? Give feedback by reacting with 👍 or 👎

@nirmal-pipeiqai nirmal-pipeiqai self-requested a review June 17, 2025 22:44
@nirmal-pipeiqai nirmal-pipeiqai dismissed their stale review June 17, 2025 22:44

new bugs from bug bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants