feat: add native chat surface#2402
Draft
MRL-00 wants to merge 22 commits into
Draft
Conversation
User messages now carry structured attachments instead of a text-only [Attached: ...] suffix. Image attachments render as expandable thumbnails in the transcript (loaded over a new nativeChat.readAttachmentImage RPC with extension allowlist and an 8MB cap, falling back to a file chip when unreadable), and composer chips show live object-URL previews for images before sending. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Inline code in both markdown variants now renders as a real pill (the old bg-muted token does not exist in the theme, so backticked names rendered flat). When a surface passes onOpenFile, inline code spans that look like workspace file paths become clickable and open in the file editor; the chat panel wires this to openFileInTaskEditor with line/column suffixes stripped. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Work from the parallel session, committed as-is so transcript persistence can build on top. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Transcripts previously lived only in main-process memory, so reopening Emdash showed an empty chat body even though the provider session resumed. Each conversation now persists to a JSON file under userData/native-chat-transcripts/ (atomic tmp+rename writes, debounced during turns, flushed on turn end and dispose). getState falls back to the persisted file when no session is live, startTurn rehydrates items and the turn sequence so new turn keys never collide, and deleting a conversation removes its transcript. Switching terminal<->native keeps it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Changing the composer's model/reasoning/speed now also saves the trio as that provider's defaults (new nativeChatDefaults app setting), and new native-chat conversations are seeded from them at creation in both the new-conversation and task-creation flows. Clearing an option back to Default clears the saved default too; access mode is excluded since agentAutoApproveDefaults already covers it at creation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
feat: Add adapter-backed native chat surface
feat(native-chat): remember model, reasoning, and speed per provider
…-upstream # Conflicts: # src/main/core/tasks/operations/createTask.ts # src/main/index.ts # src/shared/conversations.ts
…istence' into sync/fork-main-with-upstream
# Conflicts: # src/main/core/conversations/createConversation.ts # src/main/core/settings/schema.ts # src/main/core/tasks/operations/createTask.ts # src/main/index.ts # src/shared/conversation-config.test.ts # src/shared/conversation-config.ts # src/shared/core/conversations/conversations.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an adapter-backed native chat surface for supported local agents, alongside the existing terminal-based conversation flow.
This includes:
Validation
pnpm run typecheckpnpm run format:checkpnpm run lintNote: lint passes with an existing upstream warning in
src/renderer/features/automations/use-automations.ts.