a2aproject / a2aproject/A2A

[Feat]: Add Ability to Specify Deadlines for Tasks

Abierto
#857 2 comentarios 0 reacciones 1 asignado Reclamado por @pstephengoogle Ver en GitHub
triaged
Lenguaje dominante
Shell
Estrellas
25.7k
Forks
2.6k
Merge medio
3 d 6 h
PR fusionados (30 d)
16

Descripción

### 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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

The issue proposes adding a `deadline` field to the `Task` and `MessageSendConfiguration` interfaces in the A2A protocol. Start by locating the TypeScript definitions for these interfaces, likely in a file like `src/protocol.ts` or similar. Understand how tasks are created and processed. The change involves updating the protocol specification, server-side validation, and potentially adding a new `deadlineExceeded` task status. Check existing tests for task handling to see how to add tests for the new deadline logic.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
typescript
Área
backend-api-design
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Tranquilo
Claridad
Bien especificado
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.