Skip to content

External-session import fails for every conversation when no default model is configured #4226

Closed

Description

@liuxiaocs7

What happened

Importing an external conversation (Settings → 活动 → 导入任务) fails for every conversation with the banner:

导入失败 — 该对话无法转换或保存。请检查来源后重试。
(Import failed — This conversation could not be converted or saved. Check the source and try again.)

It fails regardless of the conversation's size or content, and regardless of the source tab (Codex / Claude Code / opencode). A 4 MB conversation fails identically to a 100 MB one.

The banner text is a generic, redacted fallback (importFailedFallback) and hides the real error, so the failure is undiagnosable from the UI alone.

Expected: with usable model connections configured, importing a conversation should create a Maka task.

How to reproduce

Precondition: the workspace has one or more enabled, usable connections but no default session model set — connection-catalog.json has defaultTarget: null. (This is a legitimate state: a default is only auto-set during onboarding bootstrap; a self-configured profile can have none. Normal chat is unaffected because it sends an explicitly picked model.)

  1. Open Settings → 活动 → 导入任务
  2. Pick any source (e.g. Codex)
  3. Click 导入 on any conversation
  4. Every import fails with "该对话无法转换或保存"

Environment

  • Maka commit: 593efb9
  • OS and version: macOS (Darwin 24.6.0)
  • Surface: Desktop (Maka Dev, from source)
  • Node.js version: 24.x

Root cause

Before reading the source conversation, HostSessionCatalogCoordinator.resolveExternalSessionImportTarget() resolves default session settings for the new task and hardcodes the model target { kind: 'default' }. #selectModelTarget() throws SessionOperationFailure('operation_unavailable', 'No default Session model is configured') when connectionCatalog.getSnapshot().defaultTarget is null.

Because this happens before the source is read, it fails every import regardless of size. The thrown error becomes importFailure('operation_unavailable', …), is re-thrown as a RuntimeHostOperationError at the IPC boundary, and the import page runs it through localizedShellErrorMessage(error, copy.importFailedFallback, locale) — the message matches none of the keyword classes in generalizedErrorMessageChinese, so it falls through to the generic banner.

Secondary: oversized rollouts (> CODEX_ROLLOUT_MAX_BYTES = 64 MB) also fail via the same generic banner (readBoundedUtf8File throws "Codex rollout exceeds …"). Separate, lower-priority.

Activity

  1. liuxiaocs7 commented on Aug 30, 2026

    @liuxiaocs7
    MemberAuthor

    take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions