Skip to content

Commit 427ab61

Browse files
scale-ballenclaude
andcommitted
fix(tests): update test payloads to match current *Params model schema
All *Params models require an `agent: Agent` field and SendEventParams uses `event` (not `message`), SendMessageParams uses `content` (not `message`). Test fixtures were written against an older schema and have been failing since the repo was initialized. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e5a6e15 commit 427ab61

File tree

1 file changed

+73
-20
lines changed

1 file changed

+73
-20
lines changed

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

Lines changed: 73 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,20 @@ async def mock_handler(params):
126126
"jsonrpc": "2.0",
127127
"method": "event/send",
128128
"params": {
129-
"task": {"id": "test-task", "agent_id": "test-agent", "status": "RUNNING"},
130-
"message": {
131-
"type": "text",
132-
"author": "user",
133-
"content": "test message",
129+
"agent": {
130+
"id": "test-agent-456",
131+
"name": "test-agent",
132+
"description": "test agent",
133+
"acp_type": "sync",
134+
"created_at": "2023-01-01T00:00:00Z",
135+
"updated_at": "2023-01-01T00:00:00Z",
136+
},
137+
"task": {"id": "test-task"},
138+
"event": {
139+
"id": "evt-1",
140+
"agent_id": "test-agent-456",
141+
"sequence_id": 1,
142+
"task_id": "test-task",
134143
},
135144
},
136145
"id": "test-1",
@@ -218,11 +227,20 @@ async def mock_handler(params):
218227
"jsonrpc": "2.0",
219228
"method": "event/send",
220229
"params": {
221-
"task": {"id": "test-task", "agent_id": "test-agent", "status": "RUNNING"},
222-
"message": {
223-
"type": "text",
224-
"author": "user",
225-
"content": "test message",
230+
"agent": {
231+
"id": "test-agent-456",
232+
"name": "test-agent",
233+
"description": "test agent",
234+
"acp_type": "sync",
235+
"created_at": "2023-01-01T00:00:00Z",
236+
"updated_at": "2023-01-01T00:00:00Z",
237+
},
238+
"task": {"id": "test-task"},
239+
"event": {
240+
"id": "evt-1",
241+
"agent_id": "test-agent-456",
242+
"sequence_id": 1,
243+
"task_id": "test-task",
226244
},
227245
},
228246
# No ID = notification
@@ -256,7 +274,17 @@ async def mock_handler(params):
256274
request = {
257275
"jsonrpc": "2.0",
258276
"method": "task/cancel",
259-
"params": {"task_id": "test-task-123"},
277+
"params": {
278+
"agent": {
279+
"id": "test-agent-456",
280+
"name": "test-agent",
281+
"description": "test agent",
282+
"acp_type": "sync",
283+
"created_at": "2023-01-01T00:00:00Z",
284+
"updated_at": "2023-01-01T00:00:00Z",
285+
},
286+
"task": {"id": "test-task-123"},
287+
},
260288
"id": "test-request-1",
261289
}
262290

@@ -280,7 +308,7 @@ def test_send_message_synchronous_response(self, base_acp_server):
280308
async def mock_execute_handler(params):
281309
return {
282310
"task_id": params.task.id,
283-
"message_content": params.message.content,
311+
"message_content": params.content.content,
284312
"status": "executed_synchronously",
285313
"custom_data": {"processed": True, "timestamp": "2024-01-01T12:00:00Z"},
286314
}
@@ -291,8 +319,16 @@ async def mock_execute_handler(params):
291319
"jsonrpc": "2.0",
292320
"method": "message/send",
293321
"params": {
294-
"task": {"id": "test-task-123", "agent_id": "test-agent", "status": "RUNNING"},
295-
"message": {
322+
"agent": {
323+
"id": "test-agent-456",
324+
"name": "test-agent",
325+
"description": "test agent",
326+
"acp_type": "sync",
327+
"created_at": "2023-01-01T00:00:00Z",
328+
"updated_at": "2023-01-01T00:00:00Z",
329+
},
330+
"task": {"id": "test-task-123"},
331+
"content": {
296332
"type": "text",
297333
"author": "user",
298334
"content": "Execute this task please",
@@ -340,7 +376,15 @@ async def mock_init_handler(params):
340376
"jsonrpc": "2.0",
341377
"method": "task/create",
342378
"params": {
343-
"task": {"id": "test-task-456", "agent_id": "test-agent", "status": "RUNNING"}
379+
"agent": {
380+
"id": "test-agent-456",
381+
"name": "test-agent",
382+
"description": "test agent",
383+
"acp_type": "sync",
384+
"created_at": "2023-01-01T00:00:00Z",
385+
"updated_at": "2023-01-01T00:00:00Z",
386+
},
387+
"task": {"id": "test-task-456"},
344388
},
345389
"id": "test-init-1",
346390
}
@@ -428,11 +472,20 @@ async def failing_handler(params):
428472
"jsonrpc": "2.0",
429473
"method": "event/send",
430474
"params": {
431-
"task": {"id": "test-task", "agent_id": "test-agent", "status": "RUNNING"},
432-
"message": {
433-
"type": "text",
434-
"author": "user",
435-
"content": "test message",
475+
"agent": {
476+
"id": "test-agent-456",
477+
"name": "test-agent",
478+
"description": "test agent",
479+
"acp_type": "sync",
480+
"created_at": "2023-01-01T00:00:00Z",
481+
"updated_at": "2023-01-01T00:00:00Z",
482+
},
483+
"task": {"id": "test-task"},
484+
"event": {
485+
"id": "evt-1",
486+
"agent_id": "test-agent-456",
487+
"sequence_id": 1,
488+
"task_id": "test-task",
436489
},
437490
},
438491
"id": "test-1",

0 commit comments

Comments
 (0)