From 09b2002cbd5d422354e18262e566a543b9fd0bc9 Mon Sep 17 00:00:00 2001 From: Declan Brady Date: Mon, 18 May 2026 19:00:57 -0400 Subject: [PATCH 1/3] fix: resolve lint and test failures from new endpoints - Import NOT_GIVEN in agents.py to fix NameError in custom create_task/cancel_task helpers - Convert tests.utils imports to relative imports so pyright can resolve them Co-Authored-By: Claude Opus 4.7 (1M context) --- src/agentex/resources/agents/agents.py | 2 +- tests/api_resources/agents/test_deployments.py | 3 ++- tests/api_resources/agents/test_schedules.py | 3 ++- tests/api_resources/test_checkpoints.py | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/agentex/resources/agents/agents.py b/src/agentex/resources/agents/agents.py index ab2949fc7..17fa76ebd 100644 --- a/src/agentex/resources/agents/agents.py +++ b/src/agentex/resources/agents/agents.py @@ -10,7 +10,7 @@ from pydantic import ValidationError from ...types import agent_rpc_params, agent_list_params, agent_rpc_by_name_params -from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._types import NOT_GIVEN, Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import path_template, maybe_transform, async_maybe_transform from ..._compat import cached_property from .schedules import ( diff --git a/tests/api_resources/agents/test_deployments.py b/tests/api_resources/agents/test_deployments.py index 3a429c0f1..7bddf7c49 100644 --- a/tests/api_resources/agents/test_deployments.py +++ b/tests/api_resources/agents/test_deployments.py @@ -8,7 +8,6 @@ import pytest from agentex import Agentex, AsyncAgentex -from tests.utils import assert_matches_type from agentex.types import AgentRpcResponse from agentex.types.agents import ( DeploymentListResponse, @@ -18,6 +17,8 @@ ) from agentex.types.shared import DeleteResponse +from ...utils import assert_matches_type + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/agents/test_schedules.py b/tests/api_resources/agents/test_schedules.py index 46ef24aa1..0431de18e 100644 --- a/tests/api_resources/agents/test_schedules.py +++ b/tests/api_resources/agents/test_schedules.py @@ -8,7 +8,6 @@ import pytest from agentex import Agentex, AsyncAgentex -from tests.utils import assert_matches_type from agentex._utils import parse_datetime from agentex.types.agents import ( ScheduleListResponse, @@ -20,6 +19,8 @@ ) from agentex.types.shared import DeleteResponse +from ...utils import assert_matches_type + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_checkpoints.py b/tests/api_resources/test_checkpoints.py index 68d297cab..3c13fd43a 100644 --- a/tests/api_resources/test_checkpoints.py +++ b/tests/api_resources/test_checkpoints.py @@ -8,13 +8,14 @@ import pytest from agentex import Agentex, AsyncAgentex -from tests.utils import assert_matches_type from agentex.types import ( CheckpointPutResponse, CheckpointListResponse, CheckpointGetTupleResponse, ) +from ..utils import assert_matches_type + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") From 330264c942098049f688a5bd66ab669fe31351d9 Mon Sep 17 00:00:00 2001 From: Declan Brady Date: Mon, 18 May 2026 19:22:05 -0400 Subject: [PATCH 2/3] fix: import missing RPC response types in agents resource The custom create_task/cancel_task/send_message/send_event helpers reference CreateTaskResponse, CancelTaskResponse, SendMessageResponse, SendMessageStreamResponse, and SendEventResponse but only AgentRpcResponse was imported, causing NameError at runtime. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/agentex/resources/agents/agents.py | 9 ++++++++- src/agentex/types/agent_rpc_response.py | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/agentex/resources/agents/agents.py b/src/agentex/resources/agents/agents.py index 17fa76ebd..8f7486e72 100644 --- a/src/agentex/resources/agents/agents.py +++ b/src/agentex/resources/agents/agents.py @@ -38,7 +38,14 @@ ) from ...types.agent import Agent from ..._base_client import make_request_options -from ...types.agent_rpc_response import AgentRpcResponse +from ...types.agent_rpc_response import ( + AgentRpcResponse, + CancelTaskResponse, + CreateTaskResponse, + SendEventResponse, + SendMessageResponse, + SendMessageStreamResponse, +) from ...types.agent_list_response import AgentListResponse from ...types.shared.delete_response import DeleteResponse diff --git a/src/agentex/types/agent_rpc_response.py b/src/agentex/types/agent_rpc_response.py index 8b464b8d7..97f0f9c2f 100644 --- a/src/agentex/types/agent_rpc_response.py +++ b/src/agentex/types/agent_rpc_response.py @@ -11,7 +11,14 @@ from .agent_rpc_result import AgentRpcResult from .task_message_update import TaskMessageUpdate -__all__ = ["AgentRpcResponse"] +__all__ = [ + "AgentRpcResponse", + "CancelTaskResponse", + "CreateTaskResponse", + "SendEventResponse", + "SendMessageResponse", + "SendMessageStreamResponse", +] class BaseAgentRpcResponse(BaseModel): From 1e3219beb27618771c965e7811ad8416ea9ad487 Mon Sep 17 00:00:00 2001 From: Declan Brady Date: Mon, 18 May 2026 19:26:39 -0400 Subject: [PATCH 3/3] fix: sort imports in agents resource Co-Authored-By: Claude Opus 4.7 (1M context) --- src/agentex/resources/agents/agents.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agentex/resources/agents/agents.py b/src/agentex/resources/agents/agents.py index 8f7486e72..3dd0c770d 100644 --- a/src/agentex/resources/agents/agents.py +++ b/src/agentex/resources/agents/agents.py @@ -40,9 +40,9 @@ from ..._base_client import make_request_options from ...types.agent_rpc_response import ( AgentRpcResponse, + SendEventResponse, CancelTaskResponse, CreateTaskResponse, - SendEventResponse, SendMessageResponse, SendMessageStreamResponse, )