a2aproject / a2aproject/A2A

[Feat]: Add Ability to Specify Deadlines for Tasks

Aberta
#857 2 comentários 0 reações 1 responsável Reivindicada por @pstephengoogle Ver no GitHub
triaged
Linguagem predominante
Shell
Estrelas
25.7k
Forks
2.6k
Merge médio
3d 6h
PRs com merge (30d)
16

Descrição

### Is your feature request related to a problem? Please describe.

There are certain tasks that are very time-sensitive.

It would be great to have the ability to optionally specify a deadline as a string (ISO 8601) field with the deadline that the server (agent) needs to provide a complete response by. There are certain scenarios where a response from the server is no longer relevant unless it is completed by a specific deadline.

A deadline is an absolute timestamp by which the server must complete the task or stream of tasks.

If this optional field is specified in the request, the server should only accept tasks that it is able to complete fully inside this deadline. If it is a streaming tasks all responses including the final response for that stream needs to be sent to the client before the deadline.

There are many scenarios in the real world where this is relevant and we should update the protocol specification to support this feature.

Servers can use this deadline specified by the clients to:
- reject requests it feels it would not be able to complete by the deadline
- always be aware of how much time it has left to complete the task
- avoid doing work that is expensive and would not finish in time for the client
- prioritize tasks accordingly
- warn about possible SLA violations
- delegate and propagate deadline to downstream agents with a shared deadline context

### Describe the solution you'd like

We can update the `Task` object with a `deadline` field that is a string (ISO 8601)

We can update the `MessageSendConfiguration` object to include the `deadline` field as well in the `message/send` and `message/stream` methods

```typescript
/** Sent by the client to the agent as a request. May create, continue or restart a task. */
export interface MessageSendParams {
/** The message being sent to the server. */
message: Message;
/** Send message configuration. */
configuration?: MessageSendConfiguration;
/** Extension metadata. */
metadata?: {
[key: string]: any;
};
}

/**Configuration for the send message request. */
export interface MessageSendConfiguration {
/** Accepted output modalities by the client. */
acceptedOutputModes: string[];
/** Number of recent messages to be retrieved. */
historyLength?: number;
/** Where the server should send notifications when disconnected. */
pushNotificationConfig?: PushNotificationConfig;
/** If the server should treat the client as a blocking request. */
blocking?: boolean;
/** Deadline to complete the task in UTC **/
deadline?: string;
}

export interface Task {
/** Unique identifier for the task */
id: string;
/** Server-generated id for contextual alignment across interactions */
contextId: string;
/** Current status of the task */
status: TaskStatus;
history?: Message[];
/** Collection of artifacts created by the agent. */
artifacts?: Artifact[];
/** Extension metadata. */
metadata?: {
[key: string]: any;
};
/** Event type */
kind: "task";

/** Deadline to complete the task in UTC **/
deadline?: string;
}
```
### Scenarios
- Servers can reject tasks they are not able to handle within the specified SLA
- Servers can stop working on the tasks an cancel them with a `deadlineExceeded` status

### Describe alternatives you've considered

_No response_

### Additional context

_No response_

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.