a2aproject / a2aproject/a2a-js

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

未关闭
#684 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
613
派生
169
平均合并
1 天 6 小时
30 天内合并 PR
21

描述

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

贡献指南

打开贡献指南

调研方向

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.

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, typescript
领域
backend-api-design
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
活跃
描述清晰度
描述清楚
新手友好度
65/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。