MCPcopy
hub / github.com/coder/mux / clearFailedAssistantMessage

Method clearFailedAssistantMessage

src/node/services/agentSession.ts:3712–3739  ·  view source on GitHub ↗
(messageId: string, reason: string)

Source from the content-addressed store, hash-verified

3710 }
3711
3712 private async clearFailedAssistantMessage(messageId: string, reason: string): Promise<void> {
3713 const [partialResult, deleteMessageResult] = await Promise.all([
3714 this.historyService.deletePartial(this.workspaceId),
3715 this.historyService.deleteMessage(this.workspaceId, messageId),
3716 ]);
3717
3718 if (!partialResult.success) {
3719 log.warn("Failed to clear partial before retry", {
3720 workspaceId: this.workspaceId,
3721 reason,
3722 error: partialResult.error,
3723 });
3724 }
3725
3726 if (
3727 !deleteMessageResult.success &&
3728 !(
3729 typeof deleteMessageResult.error === "string" &&
3730 deleteMessageResult.error.includes("not found in history")
3731 )
3732 ) {
3733 log.warn("Failed to delete failed assistant placeholder", {
3734 workspaceId: this.workspaceId,
3735 reason,
3736 error: deleteMessageResult.error,
3737 });
3738 }
3739 }
3740
3741 private async finalizeCompactionRetry(messageId: string): Promise<void> {
3742 this.activeCompactionRequest = undefined;

Calls 2

deletePartialMethod · 0.80
deleteMessageMethod · 0.45

Tested by

no test coverage detected