Skip to content

Commit 7b31a87

Browse files
author
Krzysztof Dziedzic
committed
fix: force itk agent to create task before updating the status
1 parent 3468180 commit 7b31a87

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

.github/workflows/itk.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ jobs:
2828
run: bash run_itk.sh
2929
working-directory: itk
3030
env:
31-
A2A_SAMPLES_REVISION: itk-v.0.11-alpha
31+
A2A_SAMPLES_REVISION: itk-v.016-alpha

itk/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ You must set the `A2A_SAMPLES_REVISION` environment variable to specify which re
3636

3737
Example:
3838
```bash
39-
export A2A_SAMPLES_REVISION=itk-v.0.11-alpha
39+
export A2A_SAMPLES_REVISION=itk-v.016-alpha
4040
```
4141

4242
### 2. Execute Tests

itk/main.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
Message,
3232
Part,
3333
SendMessageRequest,
34+
Task,
3435
TaskState,
36+
TaskStatus,
3537
)
3638
from a2a.utils import TransportProtocol
3739

@@ -196,7 +198,16 @@ async def execute(
196198
context.context_id,
197199
)
198200

199-
await task_updater.update_status(TaskState.TASK_STATE_SUBMITTED)
201+
# Explicitly create the task by sending it to the queue
202+
task = Task(
203+
id=context.task_id,
204+
context_id=context.context_id,
205+
status=TaskStatus(state=TaskState.TASK_STATE_SUBMITTED),
206+
history=[context.message] if context.message else [],
207+
)
208+
async with task_updater._lock:
209+
await event_queue.enqueue_event(task)
210+
200211
await task_updater.update_status(TaskState.TASK_STATE_WORKING)
201212

202213
instruction = extract_instruction(context.message)

0 commit comments

Comments
 (0)