Skip to content

The simpleStreamableHttp example client call tool(second) always timeout(reconnect)~ #396

Closed
@cnych

Description

@cnych

Describe the bug

simpleStreamableHttp The client calls the tool normally for the first time, and the second time will time out. This is because the code initialized by the client is as follows:

// src/examples/client/simpleStreamableHttp.ts#L340
const onLastEventIdUpdate = (event: string) => {
notificationsToolLastEventId = event;
};
const result = await client.request(request, CallToolResultSchema, {
resumptionToken: notificationsToolLastEventId, 
onresumptiontoken: onLastEventIdUpdate
});

If the value of resumptionToken is not empty, the GET request will be called in the StreamableHTTPClientTransport, and the request will be replayed. This should be a scenario where the client interrupts and needs to reconnect. ResumptionToken should be configured.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions