Skip to content

Commit 0981979

Browse files
Fix simple typing issues in lib directory
- Add missing RetryPolicy parameters with reasonable defaults - Fix missing Agent created_at/updated_at timestamps in test fixtures - Add type ignore for intentional test error case - Provide missing temporal_address parameter in test
1 parent a898520 commit 0981979

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

src/agentex/lib/core/clients/temporal/temporal_client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818

1919
logger = make_logger(__name__)
2020

21-
DEFAULT_RETRY_POLICY = RetryPolicy(maximum_attempts=1)
21+
DEFAULT_RETRY_POLICY = RetryPolicy(
22+
maximum_attempts=1,
23+
initial_interval=timedelta(seconds=1),
24+
backoff_coefficient=2.0,
25+
maximum_interval=timedelta(minutes=10)
26+
)
2227

2328

2429
TEMPORAL_STATUS_TO_UPLOAD_STATUS_AND_REASON = {

src/agentex/lib/sdk/fastacp/tests/conftest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ def sample_send_message_params(
7272
name="test-agent",
7373
description="test-agent",
7474
acp_type="sync",
75+
created_at="2023-01-01T00:00:00Z",
76+
updated_at="2023-01-01T00:00:00Z",
7577
),
7678
task=sample_task,
7779
content=sample_message_content,
@@ -83,7 +85,7 @@ def sample_send_message_params(
8385
def sample_cancel_task_params() -> CancelTaskParams:
8486
"""Fixture that provides sample CancelTaskParams"""
8587
return CancelTaskParams(
86-
agent=Agent(id="test-agent-456", name="test-agent", description="test-agent", acp_type="sync"),
88+
agent=Agent(id="test-agent-456", name="test-agent", description="test-agent", acp_type="sync", created_at="2023-01-01T00:00:00Z", updated_at="2023-01-01T00:00:00Z"),
8789
task=Task(id="test-task-123", agent_id="test-agent-456", status="running"),
8890
)
8991

@@ -92,7 +94,7 @@ def sample_cancel_task_params() -> CancelTaskParams:
9294
def sample_create_task_params(sample_task: Task) -> CreateTaskParams:
9395
"""Fixture that provides sample CreateTaskParams"""
9496
return CreateTaskParams(
95-
agent=Agent(id="test-agent-456", name="test-agent", description="test-agent", acp_type="sync"),
97+
agent=Agent(id="test-agent-456", name="test-agent", description="test-agent", acp_type="sync", created_at="2023-01-01T00:00:00Z", updated_at="2023-01-01T00:00:00Z"),
9698
task=sample_task,
9799
params={},
98100
)

src/agentex/lib/sdk/fastacp/tests/test_fastacp_factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ async def test_agentic_direct_method_requires_config(self):
212212
with patch.dict("os.environ", {"AGENTEX_BASE_URL": ""}):
213213
# This should raise TypeError since config is required parameter
214214
with pytest.raises(TypeError):
215-
FastACP.create_agentic_acp()
215+
FastACP.create_agentic_acp() # type: ignore[call-arg]
216216

217217
def test_invalid_acp_type_string(self):
218218
"""Test that invalid ACP type string raises ValueError"""

src/agentex/lib/sdk/fastacp/tests/test_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ async def test_temporal_acp_creation_with_mocked_client(self):
4949
mock_temporal_instance.temporal_client = MagicMock()
5050
mock_create.return_value = mock_temporal_instance
5151

52-
temporal_acp = await TemporalACP.create()
52+
temporal_acp = await TemporalACP.create(temporal_address="localhost:7233")
5353

5454
assert temporal_acp == mock_temporal_instance
5555
assert hasattr(temporal_acp, "temporal_client")

0 commit comments

Comments
 (0)