a2aproject / a2aproject/a2a-js

[Bug]: toCoreMessage defaults optional taskId to "" instead of undefined

オープン 初心者向け
#678 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
613
フォーク
169
平均マージ
1日 6時間
マージ済み PR(30日)
21

説明

### What happened?

When a v0.3 message does not have a `taskId`, `toCoreMessage` in the compat layer sets it to `""` instead of leaving it as `undefined`:

```
// dist/compat/v0_3/client/index.js, line 996
taskId: compatMsg.taskId ?? "",
```

`taskId` is optional in v0.3, so not every message has one. Setting it to `""` causes problems for consumers that check whether `taskId` is present, because `""` looks like a value but is not a valid task ID. In JavaScript, an optional field that is not set should be `undefined`, not `""`.

### Relevant log output

```shell

```

### Code of Conduct

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

The issue points to the file `dist/compat/v0_3/client/index.js` at line 996. Start by finding the source file for this compat layer, likely in `src/compat/v0_3/client/`. Look for the `toCoreMessage` function and the line setting `taskId`. Understand the v0.3 message schema to confirm `taskId` is optional. Change the default from an empty string to `undefined`. Run any existing tests for the compat layer to ensure the change works and doesn't break anything.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, typescript
領域
backend-api-design
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
活発
明瞭さ
明確に書かれている
初心者へのやさしさ
75/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。