-
Notifications
You must be signed in to change notification settings - Fork 246
Description
Problem
When sharing conversation context via Publish as GitHub Gist, Copy Context, or other export methods, thinking/reasoning logs are silently stripped out. The formatLogsForClipboard() function in src/renderer/utils/contextExtractor.ts (line 667) explicitly filters to only user, ai, and stdout sources — excluding thinking, tool, system, stderr, and error entries.
This means shared conversations are missing potentially valuable reasoning context. When a user shares a conversation to show how an agent arrived at a solution (not just the final output), the thinking logs are essential.
Note: HTML export (generateTabExportHtml in src/renderer/utils/tabExport.ts) already includes thinking logs — this inconsistency makes the gap more noticeable.
Proposed Solution
Add an "Include thinking/reasoning" toggle to the context sharing flow. When enabled, thinking blocks are included in the exported content.
Affected export paths
| Export method | Current behavior | Proposed |
|---|---|---|
| Copy Context (clipboard) | Thinking excluded | Opt-in toggle |
| Publish as GitHub Gist | Thinking excluded | Opt-in toggle in GistPublishModal |
| HTML Export | Thinking already included | No change needed |
Implementation notes
formatLogsForClipboard()(src/renderer/utils/contextExtractor.ts:667) — Add an optionalincludeThinking?: booleanparameter. When true, includesource: 'thinking'entries, formatted with a clearTHINKING:header to distinguish them from assistant responses.GistPublishModal.tsx— Add a checkbox/toggle: "Include reasoning/thinking logs". Pass the flag through toformatLogsForClipboard()via the export handler.useTabExportHandlers.ts—handleCopyContext()andhandlePublishTabGist()both useformatLogsForClipboard(). Both should respect the toggle. For clipboard copy (which has no modal), consider either a settings-level preference or a secondary menu option.- Formatting — Thinking blocks should be visually distinct in the markdown output (e.g., wrapped in a
<details>tag or prefixed withTHINKING:) so they don't get confused with assistant responses.
UX considerations
- Default should be off (current behavior preserved) — thinking logs can be verbose and many users won't want them in shared gists.
- The toggle should be per-export, not a global setting, since the same user may want thinking in some shares but not others.
- Consider also including
toolsource entries as an additional option, since tool calls (file reads, searches, etc.) provide important context for understanding the conversation flow.
Files involved
src/renderer/utils/contextExtractor.ts—formatLogsForClipboard()src/renderer/components/GistPublishModal.tsx— Toggle UIsrc/renderer/hooks/tabs/useTabExportHandlers.ts— Pass flag throughsrc/renderer/types/index.ts—LogEntry.sourcetype (reference only)