Skip to content

feat: ChatWise export import support #91

Description

@andrewchumchal

Overview

Add the ability to import conversation history from a ChatWise export (.zip file) into OpenConduit.

ChatWise exports a single .zip containing:

  • chat-{id}.json — one file per conversation, messages inline
  • assistants.json — personas with system prompts and MCP config
  • providers.json — custom provider definitions (contains API keys — must not be auto-imported)
  • prompts.json — prompt templates
  • config.json — app-wide settings (contains API keys — must not be auto-imported)

Mapping: ChatWise → OpenConduit

Conversations (chat-*.jsonConversation)

ChatWise field OpenConduit field Notes
id id Prefix with cw_ to avoid collisions
title title
createdAt / updatedAt createdAt / updatedAt ISO → epoch ms
systemInstruction systemPrompt
model providerId + model See model mapping below

Messages (messages[]Message[])

ChatWise field OpenConduit field Notes
id id
role (user/assistant) role Direct map
content content Must strip @message_part::* markers (see below)
reasoningContent thinking
createdAt timestamp ISO → epoch ms
model model
meta.parts.toolu_* toolCalls[] Parse tool call parts into ToolCall objects
files[] attachments[] Only local paths are exported — no binary data. Mark as unavailable or skip.

Content cleanup

ChatWise embeds streaming part markers in content strings:

@message_part::reasoning-1_0
@message_part::toolu_01E3ggHqPFYDzXhCFE6AM9Mq

These must be stripped from the displayed text. Tool call data lives in meta.parts.

Model string mapping

ChatWise uses these formats:

  • Built-in: anthropic-claude-4.5-sonnet{ providerId: "anthropic", model: "claude-4.5-sonnet" }
  • Built-in: openai-gpt-4o{ providerId: "openai", model: "gpt-4o" } (etc.)
  • Custom: cus_{id}-{modelId} → look up in providers.json, map to closest built-in provider type or leave as unknown

Scope

MVP (conversations only)

  • Parser: ZIP extraction (in-memory via jszip or adm-zip) in the Electron main process
  • Parser: chat-*.jsonConversation[] with content cleanup, tool call extraction, model mapping
  • IPC handler: import:chatwise — takes a file path, returns parsed conversations
  • UI: Import dialog in @openconduit/core — file picker → conversation list with checkboxes → confirm
  • Store: insert imported conversations (dedup by prefixed ID)

Follow-up (optional)

  • Import assistants as system-prompt presets or personas
  • Import prompt templates

Explicitly out of scope

  • Provider import (API keys in the export — security risk)
  • Config/settings import (completely different settings model)

Security note

providers.json and config.json in the export contain plaintext API keys. The import flow must not auto-import these. If provider import is ever added, keys must require explicit user opt-in and be handled through the existing secure IPC → electron-store path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions