a2aproject / a2aproject/a2a-js

[Bug]: sendMessage persists follow-up history before the required-extension check

Ouverte
#684 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
TypeScript
Étoiles
613
Forks
169
Merge moyen
1 j 6 h
PR mergées (30 j)
21

Description

### What happened?

`_createRequestContext` appends `incomingMessage` to history and `save()`s, then later throws `ExtensionSupportRequiredError` if a required extension is missing. Existing tests only cover new messages (`taskId: ""`), so the follow-up path is untested.

A client that forgets a required extension on a follow-up still permanently appends that message. Later getTask/listTasks/resubscribe show a message the server refused to execute.

**Repro**
1. Create a task.
2. Configure the agent card with a required extension.
3. sendMessage a follow-up with that taskId and no A2A-Extensions.

Observed: the call throws, but `taskStore.load(taskId).history` already contains the follow-up.
Expected: history unchanged.

### Relevant log output

n/a.

### Code of Conduct

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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Look at the `_createRequestContext` function where history is appended and saved. The bug is that this save happens before the required-extension check. Find the test suite for new messages (`taskId: ""`) and write a similar test for the follow-up path. Verify the fix by ensuring the history is not saved when `ExtensionSupportRequiredError` is thrown.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript, typescript
Domaine
backend-api-design
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
Active
Clarté
Clairement spécifiée
Accessibilité débutants
65/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.