Skip to content

update changelog #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 115 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,120 @@
# Changelog

## 0.2.0-beta (2025-06-24)

### A2A Specification Upgrade ([a2a spec v0.1.0](https://github.com/google-a2a/A2A/releases/tag/v0.1.0) -> [a2a spec v0.2.0](https://github.com/google-a2a/A2A/releases/tag/v0.2.0))

#### Protocol Specification Changes

##### 1. Protocol Method Names

- `tasks/send` → `message/send`
- `tasks/sendSubscribe` → `message/stream`
- `tasks/pushNotification/set` → `tasks/pushNotificationConfig/set`
- `tasks/pushNotification/get` → `tasks/pushNotificationConfig/get`
- Added `agent/authenticatedExtendedCard` method
- Legacy methods retained for backward compatibility but deprecated

##### 2. A2A Core Data Structure Updates

Following the A2A specification upgrade, core data structures have been updated to align with the new protocol requirements. These changes include modifications to Task, Message, Part structures, file handling mechanisms, task states, agent card configurations, artifacts, and streaming events.

For detailed specification changes, refer to the official A2A specification comparison:
- **Previous Specification**: [A2A v0.1.0 JSON Schema](https://github.com/google-a2a/A2A/blob/v0.1.0/specification/json/a2a.json)
- **Current Specification**: [A2A v0.2.0 JSON Schema](https://github.com/google-a2a/A2A/blob/v0.2.0/specification/json/a2a.json)

#### Interface Evolution

TaskProcessor → MessageProcessor:
```go
// Old interface
type TaskProcessor interface {
Process(ctx context.Context, taskID string, initialMsg protocol.Message, handle TaskHandle) error
}

// New interface
type MessageProcessor interface {
ProcessMessage(ctx context.Context, message protocol.Message, options ProcessOptions, taskHandler TaskHandler) (*MessageProcessingResult, error)
}
```

Key Changes:
- **Processing Model**: Task-driven → Message-driven processing
- **Parameters**: Removed `taskID`, added `ProcessOptions` for configuration
- **Return Type**: Simple `error` → Structured `*MessageProcessingResult`
- **Handler Interface**: `TaskHandle` → `TaskHandler` (enhanced capabilities)

TaskHandler Interface Enhancement:
- **Method Evolution**: `GetSessionID()` → `GetContextID()` (A2A spec compliance)
- **New Capabilities**: Added `BuildTask()`, `GetTask()`, `SubScribeTask()`, `GetMessageHistory()`
- **Enhanced Parameters**: `AddArtifact()` now supports `taskID`, `isFinal`, `needMoreData`

TaskManager Interface Updates:
- **New Methods**: Added `OnSendMessage()`, `OnSendMessageStream()` (A2A 0.2.0 methods)
- **Updated Returns**: `OnResubscribe()` now returns `<-chan protocol.StreamingMessageEvent`
- **Backward Compatibility**: Legacy methods (`OnSendTask`, `OnSendTaskSubscribe`) deprecated but retained

Constructor Changes:
- `NewMemoryTaskManager(TaskProcessor)` → `NewMemoryTaskManager(MessageProcessor, ...MemoryTaskManagerOption)`

#### Implementation Updates

- **Memory TaskManager**: Completely restructured for specification compliance
- Constructor signature changed: `NewMemoryTaskManager(TaskProcessor)` → `NewMemoryTaskManager(MessageProcessor, ...MemoryTaskManagerOption)`
- Internal data structures reorganized:
- `Messages` field: `map[string][]Message` → `map[string]Message`
- `Tasks` field: `map[string]*Task` → `map[string]*MemoryCancellableTask`
- `Subscribers` field: `map[string][]chan<- TaskEvent` → `map[string][]*MemoryTaskSubscriber`
- Removed internal mutex fields (`MessagesMutex`, `TasksMutex`, etc.) for simplified synchronization
- Added new types: `MemoryCancellableTask`, `MemoryTaskSubscriber`
- Added configuration options: `MemoryTaskManagerOption`, `WithConversationTTL`, `WithMaxHistoryLength`

- **Redis TaskManager**: Restructured implementation to support specification requirements
- Split into focused modules:
- `redis_manager.go` - main TaskManager implementation
- `redis_types.go` - Redis-specific type definitions
- `redis_options.go` - configuration options
- `redis_task_handle.go` - task handle implementation
- Removed legacy files: `options.go`, `push_notification.go`, `task.go`, `redis.go`
- Fixed `GetSessionID()` method support as required by specification (#30)

- **Interface Updates**: Updated interfaces to match specification requirements
- **TaskManager Interface**: Added `OnSendMessage()` and `OnSendMessageStream()` methods
- **TaskHandler Interface**: Renamed `GetSessionID()` to `GetContextID()` per specification
- **MessageProcessor Interface**: Updated to support new processing requirements

- **Client & Server**: Updated implementations to support new protocol methods
- Client updated for new endpoint support
- Server route handlers updated for new methods
- Request/response handling updated per specification


##### Client Code Updates

- Replace `client.SendTask()` calls with `client.SendMessage()`
- Replace `client.SendTaskSubscribe()` calls with `client.StreamMessage()`
- Update request/response structures for new Message-based APIs

##### Server Code Updates

- Update route handlers for new method names
- Implement new `OnSendMessage()` and `OnSendMessageStream()` handlers
- Update AgentCard configuration for new security fields

#### Deprecated Methods

##### Legacy TaskManager Methods

**OnSendTask()** (Deprecated → Use OnSendMessage()):
- Legacy method for `tasks/send` protocol method
- Replaced by `OnSendMessage()` for `message/send` method

**OnSendTaskSubscribe()** (Deprecated → Use OnSendMessageStream()):
- Legacy method for `tasks/sendSubscribe` protocol method
- Replaced by `OnSendMessageStream()` for `message/stream` method

These methods remain functional for backward compatibility but are deprecated in favor of the new A2A 0.2.0 specification methods.

## 0.0.3 (2025-05-21)

- Add `GetSessionId` to `TaskHandle` (#27)
Expand Down
15 changes: 0 additions & 15 deletions taskmanager/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,21 +133,6 @@ type MessageProcessor interface {
) (*MessageProcessingResult, error)
}

// MessageProcessorWithStatusUpdate is an optional interface that can be implemented by TaskProcessor
// to receive notifications when the task status changes.
type MessageProcessorWithStatusUpdate interface {
MessageProcessor
// OnTaskStatusUpdate is called when the task status changes.
// It receives the task ID, the new state, and the optional message.
// It should return an error if the status update fails.
OnTaskStatusUpdate(
ctx context.Context,
taskID string,
state protocol.TaskState,
message *protocol.Message,
) error
}

// TaskManager defines the interface for managing A2A task lifecycles based on the protocol.
// Implementations handle task creation, updates, retrieval, cancellation, and events,
// delegating the actual processing logic to an injected MessageProcessor.
Expand Down
Loading