1601
await agent.chats.sendMessage(chatUri, message.text, resolvedWorkingDirectory, resolvedAttachments, turnId, senderClientId);
1602
} catch (err) {
1604
>
const error = failure.error;
1605
>
this._logService.error(`[AgentSideEffects] ${failureStage} failed for session=${turnChannel}: code=${failure.errorCode}, message=${error.message}, type=${failure.errorName}`, err);
1606
>
this._stateManager.dispatchServerAction(turnChannel, {
1607
>
type: ActionType.ChatError,
1608
>
turnId,
1609
>
duration: this._turnDuration(turnStopWatch),
1610
>
error,
1611
>
});
1612
>
this._turnTracker.turnCompleted(turnChannel, turnId, 'error', failure);
1613
>
this._toolCallTracker.clearSession(turnChannel);
1614
>
this._failSessionCreationIfStillCreating(sessionChannel, error);
1615
>
}
1616
}
1617