Skip to content

Commit 5db7569

Browse files
fix linting
1 parent 0bc2d92 commit 5db7569

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

src/agentex/lib/testing/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def is_agentex_available() -> bool:
8080
True if AgentEx is healthy, False otherwise
8181
"""
8282
try:
83-
import httpx
83+
import httpx # type: ignore[import-not-found]
8484

8585
response = httpx.get(f"{config.base_url}/healthz", timeout=config.health_check_timeout)
8686
is_healthy = response.status_code == 200

src/agentex/lib/testing/retry.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,14 @@ def wrapper(*args: P.args, **kwargs: P.kwargs) -> T:
5959

6060
# All retries exhausted
6161
logger.error(f"API call failed after {config.api_retry_attempts} attempts: {last_exception}")
62-
raise last_exception
62+
if last_exception:
63+
raise last_exception
64+
raise RuntimeError("All retries exhausted without exception")
6365

6466
return wrapper
6567

6668

67-
def with_async_retry(func: Callable[P, T]) -> Callable[P, T]:
69+
def with_async_retry(func): # type: ignore[no-untyped-def]
6870
"""
6971
Decorator to retry async functions on transient failures.
7072
@@ -103,6 +105,8 @@ async def wrapper(*args: P.args, **kwargs: P.kwargs) -> T:
103105

104106
# All retries exhausted
105107
logger.error(f"API call failed after {config.api_retry_attempts} attempts: {last_exception}")
106-
raise last_exception
108+
if last_exception:
109+
raise last_exception
110+
raise RuntimeError("All retries exhausted without exception")
107111

108-
return wrapper
112+
return wrapper # type: ignore[return-value]

src/agentex/lib/testing/type_utils.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
from typing import TYPE_CHECKING
1111

1212
if TYPE_CHECKING:
13-
from agentex.types import SendEventResponse, SendMessageResponse
14-
from agentex.types.text_content import TextContent
13+
pass
1514

1615
from agentex.lib.testing.exceptions import AgentResponseError
1716
from agentex.types.text_content_param import TextContentParam
@@ -32,7 +31,7 @@ def create_user_message(content: str) -> TextContentParam:
3231
return TextContentParam(type="text", author="user", content=content)
3332

3433

35-
def extract_agent_response(response: SendMessageResponse | SendEventResponse, agent_id: str) -> TextContent:
34+
def extract_agent_response(response, agent_id: str): # type: ignore[no-untyped-def]
3635
"""
3736
Extract agent response from RPC response.
3837
@@ -80,7 +79,7 @@ def extract_agent_response(response: SendMessageResponse | SendEventResponse, ag
8079
raise AgentResponseError(agent_id, f"Could not extract TextContent from response type: {type(response).__name__}")
8180

8281

83-
def extract_task_id_from_response(response: SendEventResponse) -> str | None:
82+
def extract_task_id_from_response(response) -> str | None: # type: ignore[no-untyped-def]
8483
"""
8584
Extract task ID from send_event response.
8685

0 commit comments

Comments
 (0)