Skip to content

Commit 32cd193

Browse files
committed
ci: add session handling to agent
1 parent b5816be commit 32cd193

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

integration/test/tools_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func (a *Agent) callMCPTool(ctx context.Context, toolName string, arguments map[
154154
Name: toolName,
155155
Arguments: arguments,
156156
})
157-
if err != nil && strings.Contains(err.Error(), "connection closed") {
157+
if err != nil && errors.Is(err, mcp.ErrConnectionClosed) {
158158
slog.Warn("MCP session dropped, reconnecting", slog.Any("error", err))
159159
if reconnErr := a.reconnect(ctx); reconnErr != nil {
160160
return "", fmt.Errorf("failed to call tool: %w (reconnect failed: %w)", err, reconnErr)

0 commit comments

Comments
 (0)