Summary
The Python SDK's LdpClient.submit_task() currently blocks until the task completes. For long-running tasks, clients need to stream progress updates via Server-Sent Events (SSE).
What to do
- Add
stream_task() method to LdpClient that returns an async iterator of TaskEvent
- Add SSE endpoint to
LdpDelegate at /ldp/stream/{task_id}
- Yield
TaskEvent.Progress, TaskEvent.Completed, or TaskEvent.Failed events
- Add
on_progress callback support in LdpDelegate.handle_task()
Example API
# Client side
async for event in client.stream_task(url, skill="reasoning", input_data={...}):
if event.type == "progress":
print(f"Progress: {event.progress}%")
elif event.type == "completed":
print(f"Result: {event.output}")
# Delegate side
class MyDelegate(LdpDelegate):
async def handle_task(self, skill, input_data, task_id):
await self.send_progress(task_id, 0.25, "Analyzing...")
await self.send_progress(task_id, 0.75, "Synthesizing...")
return {"answer": "done"}, 0.92
Why this matters
Streaming is table-stakes for production agent systems. Without it, long tasks appear frozen from the client's perspective. A2A supports streaming via SSE — LDP should too.
References
Acceptance criteria
Summary
The Python SDK's
LdpClient.submit_task()currently blocks until the task completes. For long-running tasks, clients need to stream progress updates via Server-Sent Events (SSE).What to do
stream_task()method toLdpClientthat returns an async iterator ofTaskEventLdpDelegateat/ldp/stream/{task_id}TaskEvent.Progress,TaskEvent.Completed, orTaskEvent.Failedeventson_progresscallback support inLdpDelegate.handle_task()Example API
Why this matters
Streaming is table-stakes for production agent systems. Without it, long tasks appear frozen from the client's perspective. A2A supports streaming via SSE — LDP should too.
References
src/adapter.rs(Rust, lines 195-254)Acceptance criteria
client.stream_task()returns an async iterator