Skip to content

Conversation

@edenreich
Copy link
Contributor

Summary

Implements async polling task handler for A2A server with background worker processing, task queuing, cleanup, and agent integration.

Changes

  • Add BackgroundTaskHandlerConfig for configurable polling, timeouts, retries
  • Implement BackgroundTaskQueue with pending/active/completed/dead-letter queues
  • Add DefaultBackgroundTaskHandler with agent integration and iterative processing
  • Integrate with A2A server builder via with_default_background_task_handler()
  • Support full task lifecycle management (submitted → working → completed/canceled)
  • Add /tasks endpoints for submission, status checking, and queue statistics
  • Include comprehensive test coverage and error handling

Test Plan

  • Run cargo test to verify all functionality
  • Test background worker task processing
  • Verify queue management and cleanup
  • Confirm agent integration works correctly
  • Test dead letter queue and retry logic

Closes #9

🤖 Generated with Claude Code

claude bot and others added 3 commits September 2, 2025 04:20
- Add BackgroundTaskHandlerConfig for configurable polling, timeouts, retries
- Implement BackgroundTaskQueue with pending/active/completed/dead-letter queues  
- Add DefaultBackgroundTaskHandler with agent integration and iterative processing
- Integrate with A2A server builder via with_default_background_task_handler()
- Support task lifecycle management (submitted → working → completed/canceled)
- Add /tasks endpoints for submission, status checking, and queue statistics
- Include comprehensive test coverage and error handling
- Support cleanup of completed tasks and dead letter queue management

Co-authored-by: Eden Reich <edenreich@users.noreply.github.com>
- Add public methods to Agent for system_prompt, provider, model, and tool_handlers access
- Fix A2A Task struct initialization with required metadata field
- Convert TaskStatus timestamp to Option<String> format as per A2A spec
- Update message conversion functions to handle proper SDK message format
- Make Agent struct cloneable by using Arc<dyn ToolHandler> instead of Box
- Add Debug implementation for BackgroundTaskQueue
- Resolve type mismatches in server endpoint handlers

Co-authored-by: Eden Reich <edenreich@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Implement async polling task handler

2 participants