AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
feat(copilot): add Export Chat as Markdown option to session menu (#13070)
## Summary Adds an **Export chat** option to the ⋯ dropdown on each CoPilot sidebar session. Clicking it fetches the full conversation and instantly downloads a `.md` file in the browser. ## Changes ### New file: `helpers/exportChatAsMarkdown.ts` - Formats user/assistant turns as `## User` / `## Assistant` markdown headers - Renders tool calls inline as `> 🔧 tool_name(args)` blockquotes — shows *what* the agent did without dumping raw JSON result blobs - Skips `role === "tool"` result messages - Sanitizes filename; uses Blob + anchor download pattern (same as `downloadArtifact.ts`) - Filename format: `chat-<title>-<YYYY-MM-DD>.md` ### Modified: `ChatSidebar.tsx` - Adds **Export chat** `DropdownMenuItem` (with `DownloadSimple` icon) between Rename and Delete chat - Fetches full session on demand via `getV2GetSession` with `limit: 2000` - Shows success/error toast feedback ## Testing 1. Open CoPilot, hover a session in the sidebar → click ⋯ 2. **Export chat** appears between Rename and Delete chat 3. Clicking it downloads `chat-<title>-<date>.md` immediately 4. File contains `## User` / `## Assistant` sections; tool calls show as `> 🔧 tool_name(...)` 5. Error toast appears if the session fetch fails --------- Co-authored-by: Toran Bruce Richards <22963551+Torantulino@users.noreply.github.com> Co-authored-by: abhi1992002 <abhimanyu1992002@gmail.com>
T
Toran Bruce Richards committed
60ce5f40a644d750599b05abdc75ef41aeb48701
Parent: 2624b6f
Committed by GitHub <noreply@github.com>
on 5/10/2026, 4:33:11 PM