ag-ui-protocol / ag-ui-protocol/ag-ui

[Bug]: a2ui with injectA2UITool not working with @ag-ui/mastra (Maybe only with a gateway?)

オープン
#2,123 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug
主要言語
Python
スター
15.9k
フォーク
1.4k
平均マージ
1日 17時間
マージ済み PR(30日)
163

説明

### Pre-flight Checklist

- [x] I have searched [existing issues](https://github.com/ag-ui-protocol/ag-ui/issues) and this hasn't been reported yet.
- [x] I am using the **latest** version AG-UI.

### Describe the Bug

I tried using `a2ui.injectA2UITool` with `@ag-ui/mastra@1.1.1`, and with an Azure OpenAI model gateway and it didn't seem to work.

### Steps to Reproduce

1. Clone https://github.com/segevfiner/mastra-copilotkit-a2ui
2. Configure models in Mastra, I used Azure OpenAI, it might only happen with a gateway, rather then with a builtin provider.
3. Run `pnpm dev` in both `apps/mastra` and `apps/web`.
4. Open the web app and try to request something that will trigger A2UI. e.g. "Render an A2UI Hello, World!"

The following appears in the log:
```
[MastraAgent] Failed to compute new-message diff for thread 4cca656f-73c6-40e7-a993-1e12a07630fe; sending full history: Error: No thread found with id 4cca656f-73c6-40e7-a993-1e12a07630fe
at Memory.validateThreadIsOwnedByResource (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@mastra+memory@1.22.1_@mastra+core@1.49.0_@bufbuild+protobuf@2.12.1_@cfworker+json-sche_e3230ec8725d846fb5afd9fb0b1295c7/node_modules/@mastra/memory/dist/chunk-2NSPHF6Q.js:22210:13)
at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
at async Memory.recall (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@mastra+memory@1.22.1_@mastra+core@1.49.0_@bufbuild+protobuf@2.12.1_@cfworker+json-sche_e3230ec8725d846fb5afd9fb0b1295c7/node_modules/@mastra/memory/dist/chunk-2NSPHF6Q.js:22254:23)
at async a.selectNewMessages (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@ag-ui+mastra@1.1.1_@ag-ui+client@0.0.57_@ag-ui+core@0.0.57_@copilotkit+runtime@1.62.2__887012df369db180e244b40d8c4f7515/node_modules/@ag-ui/mastra/dist/mastra-CSCQQcep.mjs:2:20730)
at async a.streamMastraAgent (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@ag-ui+mastra@1.1.1_@ag-ui+client@0.0.57_@ag-ui+core@0.0.57_@copilotkit+runtime@1.62.2__887012df369db180e244b40d8c4f7515/node_modules/@ag-ui/mastra/dist/mastra-CSCQQcep.mjs:2:23642)
at async file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@ag-ui+mastra@1.1.1_@ag-ui+client@0.0.57_@ag-ui+core@0.0.57_@copilotkit+runtime@1.62.2__887012df369db180e244b40d8c4f7515/node_modules/@ag-ui/mastra/dist/mastra-CSCQQcep.mjs:2:7342
Error in agent stream {
error: Error: Could not find config for provider azure-openai with model id azure-openai/gpt-5.2
at ModelsDevGateway.getApiKey (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@mastra+core@1.49.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_ai@6.0.219_zo_3d5e7974ae69497d048e288599414839/node_modules/@mastra/core/dist/chunk-JZ2DMN2U.js:10425:13)
at _GatewayManager.resolveAuth (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@mastra+core@1.49.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_ai@6.0.219_zo_3d5e7974ae69497d048e288599414839/node_modules/@mastra/core/dist/chunk-QP7WV7OW.js:5289:29)
at async _ModelRouterLanguageModel.resolveAuth (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@mastra+core@1.49.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_ai@6.0.219_zo_3d5e7974ae69497d048e288599414839/node_modules/@mastra/core/dist/chunk-25T7U65K.js:379:25)
at async _ModelRouterLanguageModel.doStream (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@mastra+core@1.49.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_ai@6.0.219_zo_3d5e7974ae69497d048e288599414839/node_modules/@mastra/core/dist/chunk-25T7U65K.js:440:14)
at async pRetry.default.retries (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@mastra+core@1.49.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_ai@6.0.219_zo_3d5e7974ae69497d048e288599414839/node_modules/@mastra/core/dist/chunk-A77V6K33.js:25962:34)
at async Module.pRetry (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/p-retry@7.1.1/node_modules/p-retry/index.js:197:19)
at async createStream (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@mastra+core@1.49.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_ai@6.0.219_zo_3d5e7974ae69497d048e288599414839/node_modules/@mastra/core/dist/chunk-A77V6K33.js:25959:16)
at async Object.start (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@mastra+core@1.49.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_ai@6.0.219_zo_3d5e7974ae69497d048e288599414839/node_modules/@mastra/core/dist/chunk-DGWOO2KD.js:104:26),
runId: '6db0add0-07c6-4013-b539-251649cfecc4',
provider: 'azure-openai',
modelId: 'gpt-5.2'
}
Error in agent stream {
error: Error: Could not find config for provider azure-openai with model id azure-openai/gpt-5.2
at ModelsDevGateway.getApiKey (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@mastra+core@1.49.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_ai@6.0.219_zo_3d5e7974ae69497d048e288599414839/node_modules/@mastra/core/dist/chunk-JZ2DMN2U.js:10425:13)
at _GatewayManager.resolveAuth (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@mastra+core@1.49.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_ai@6.0.219_zo_3d5e7974ae69497d048e288599414839/node_modules/@mastra/core/dist/chunk-QP7WV7OW.js:5289:29)
at async _ModelRouterLanguageModel.resolveAuth (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@mastra+core@1.49.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_ai@6.0.219_zo_3d5e7974ae69497d048e288599414839/node_modules/@mastra/core/dist/chunk-25T7U65K.js:379:25)
at async _ModelRouterLanguageModel.doStream (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@mastra+core@1.49.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_ai@6.0.219_zo_3d5e7974ae69497d048e288599414839/node_modules/@mastra/core/dist/chunk-25T7U65K.js:440:14)
at async pRetry.default.retries (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@mastra+core@1.49.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_ai@6.0.219_zo_3d5e7974ae69497d048e288599414839/node_modules/@mastra/core/dist/chunk-A77V6K33.js:25962:34)
at async Module.pRetry (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/p-retry@7.1.1/node_modules/p-retry/index.js:197:19)
at async createStream (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@mastra+core@1.49.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_ai@6.0.219_zo_3d5e7974ae69497d048e288599414839/node_modules/@mastra/core/dist/chunk-A77V6K33.js:25959:16)
at async Object.start (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@mastra+core@1.49.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_ai@6.0.219_zo_3d5e7974ae69497d048e288599414839/node_modules/@mastra/core/dist/chunk-DGWOO2KD.js:104:26),
runId: '310153c9-71ee-4291-b65b-5147a4beb9bf',
provider: 'azure-openai',
modelId: 'gpt-5.2'
}
Error in agent stream {
error: Error: Could not find config for provider azure-openai with model id azure-openai/gpt-5.2
at ModelsDevGateway.getApiKey (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@mastra+core@1.49.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_ai@6.0.219_zo_3d5e7974ae69497d048e288599414839/node_modules/@mastra/core/dist/chunk-JZ2DMN2U.js:10425:13)
at _GatewayManager.resolveAuth (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@mastra+core@1.49.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_ai@6.0.219_zo_3d5e7974ae69497d048e288599414839/node_modules/@mastra/core/dist/chunk-QP7WV7OW.js:5289:29)
at async _ModelRouterLanguageModel.resolveAuth (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@mastra+core@1.49.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_ai@6.0.219_zo_3d5e7974ae69497d048e288599414839/node_modules/@mastra/core/dist/chunk-25T7U65K.js:379:25)
at async _ModelRouterLanguageModel.doStream (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@mastra+core@1.49.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_ai@6.0.219_zo_3d5e7974ae69497d048e288599414839/node_modules/@mastra/core/dist/chunk-25T7U65K.js:440:14)
at async pRetry.default.retries (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@mastra+core@1.49.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_ai@6.0.219_zo_3d5e7974ae69497d048e288599414839/node_modules/@mastra/core/dist/chunk-A77V6K33.js:25962:34)
at async Module.pRetry (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/p-retry@7.1.1/node_modules/p-retry/index.js:197:19)
at async createStream (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@mastra+core@1.49.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_ai@6.0.219_zo_3d5e7974ae69497d048e288599414839/node_modules/@mastra/core/dist/chunk-A77V6K33.js:25959:16)
at async Object.start (file:///Users/segevfiner/junk/mastra-copilotkit-a2ui/node_modules/.pnpm/@mastra+core@1.49.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_ai@6.0.219_zo_3d5e7974ae69497d048e288599414839/node_modules/@mastra/core/dist/chunk-DGWOO2KD.js:104:26),
runId: 'c47533a2-4bc7-40d1-82f0-5a41655df23b',
provider: 'azure-openai',
modelId: 'gpt-5.2'
}
```

The first is probably some other issue in @ag-ui/mastra, the other might be the cause.

### Expected Behavior

It should just work.

### Environment

```text
@ag-ui/mastra@1.1.1
Node 22.22.2
```

### Screenshots

_No response_

### Logs & Errors

```shell

```

### Additional Context

_No response_

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

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

評価

この issue はまだ評価されていません。

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

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