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

[Bug]: @ag-ui/mastra: resume after a suspended tool drops clientTools, toolsets and untilIdle

Đang mở
#2,667 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
15.9k
Fork
1.4k
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
163

Mô tả

### Describe the Bug

`run()` builds the options for the initial `agent.stream()` with `clientTools` (from `input.tools`), the A2UI `toolsets` and `untilIdle`. The resume branch builds `resumeOptions` with only `toolCallId`, `runId`, `memory` and `requestContext` (plus `abortSignal`, `tracingOptions` and headers) and hands that to `agent.resumeStream()`.

After the suspended tool returns, the model no longer sees any frontend tool. An agent that answers exclusively through frontend tools (CopilotKit tools, A2UI) ends the resumed run right after the tool result with no visible output.

### Steps to Reproduce

1. Mastra agent with a server tool that calls `suspend()`; frontend tools registered on the client so they arrive in `RunAgentInput.tools`.
2. First run: the tool suspends, the client receives the interrupt.
3. Resume with the interrupt answer.
4. The resumed stream carries the tool result and `RUN_FINISHED`, no frontend tool call and no text. Logging the tools the model receives on resume shows none of the client tools.

### Expected Behavior

The resumed run offers the model the same tools and run options as the initial run: `clientTools`, `toolsets`, `untilIdle`.

### Environment

```
@ag-ui/mastra 1.1.2, @ag-ui/core 0.0.59
@mastra/core 1.63.2, @mastra/memory 1.28.1, @mastra/libsql 1.22.2
Node 24.17.0, client @copilotkit/angular 0.5.1
```

### Additional Context

Both option sets live in `mastra.ts` (`streamOptions` before `agent.stream(...)`, `resumeOptions` in the interrupt branch of `run()`). Building one shared option set and adding `toolCallId`/`runId` for resume would fix it. Related: #2661, #2662, #2663, #2664 from the same migration. Happy to send a PR if that direction is fine.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.