From a2370a0e3bdf2ce97b44f04b53d78d8967cf137a Mon Sep 17 00:00:00 2001 From: Kayvan Sylvan Date: Thu, 15 Jan 2026 15:16:40 -0800 Subject: [PATCH] chore: Note in the guide about restricted env + modernize fixes --- docs/Microsoft-365-Copilot-Setup.md | 2 ++ internal/plugins/ai/copilot/copilot.go | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/Microsoft-365-Copilot-Setup.md b/docs/Microsoft-365-Copilot-Setup.md index 3c0b2df1..d3f3c597 100644 --- a/docs/Microsoft-365-Copilot-Setup.md +++ b/docs/Microsoft-365-Copilot-Setup.md @@ -2,6 +2,8 @@ This guide walks you through setting up and using Microsoft 365 Copilot with Fabric CLI. Microsoft 365 Copilot provides AI capabilities grounded in your organization's Microsoft 365 data, including emails, documents, meetings, and more. +> NOTE: As per the conversation in [discussion 1853](https://github.com/danielmiessler/Fabric/discussions/1853) - enterprise users with restrictive consent policies will probably need their IT admin to either create an app registration with the required permissions, or grant admin consent for an existing app like Graph Explorer. + ## Table of Contents - [What is Microsoft 365 Copilot?](#what-is-microsoft-365-copilot) diff --git a/internal/plugins/ai/copilot/copilot.go b/internal/plugins/ai/copilot/copilot.go index 5e0bdb87..a00d4150 100644 --- a/internal/plugins/ai/copilot/copilot.go +++ b/internal/plugins/ai/copilot/copilot.go @@ -381,8 +381,7 @@ func (c *Client) parseSSEStream(reader io.Reader, channel chan domain.StreamUpda newText := c.extractResponseText(event.Messages) if newText != "" && newText != lastMessageText { // Send only the delta (new content) - if strings.HasPrefix(newText, lastMessageText) { - delta := strings.TrimPrefix(newText, lastMessageText) + if delta, ok := strings.CutPrefix(newText, lastMessageText); ok { if delta != "" { channel <- domain.StreamUpdate{Type: domain.StreamTypeContent, Content: delta} } @@ -474,7 +473,7 @@ type responseMessage struct { ID string `json:"id"` Text string `json:"text"` CreatedDateTime string `json:"createdDateTime"` - AdaptiveCards []interface{} `json:"adaptiveCards,omitempty"` + AdaptiveCards []any `json:"adaptiveCards,omitempty"` Attributions []attribution `json:"attributions,omitempty"` }