Skip to content

[BUG] [v0.0.7] cortex export --format yaml produces files that cortex import rejects #44938

@marvinayisi

Description

@marvinayisi

Project

cortex

Description

cortex export --format yaml generates a structured session export, but cortex import rejects that file because the importer only deserializes JSON. This breaks the export/import round-trip for a format that the exporter explicitly supports.

repro.mp4

Error Message

Error: Failed to parse JSON from file: expected value at line 1 column 1

Debug Logs

Relevant code paths:
- src/cortex-cli/src/export_cmd.rs:22, 211-212 -> exporter supports ExportFormat::Yaml and serializes YAML
- src/cortex-cli/src/import_cmd.rs:73-99 -> importer always calls serde_json::from_str(&json_content)

System Information

cortex 0.0.7 (7954d02 2026-04-02)
ProductName: macOS
ProductVersion: 26.1
BuildVersion: 25B78
Darwin Lydias-MacBook-Pro.local 25.1.0 Darwin Kernel Version 25.1.0: Mon Oct 20 19:34:03 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T8112 arm64

Screenshots

repro.mp4

Steps to Reproduce

  1. Import any valid portable session JSON so there is a session available to export.
  2. Run HOME=<tmp> cortex export <session-id> --format yaml -o out.yaml.
  3. Run HOME=<tmp> cortex import out.yaml.

Expected Behavior

A session exported in a supported structured format should be importable back into cortex, or the exporter should not present that format as a portable export.

Actual Behavior

The YAML export is generated successfully, but cortex import immediately rejects it with a JSON parse error.

Additional Context

Duplicate-check note: searched for export --format yaml import rejects YAML portable format, cortex export yaml import only json, and similar variants. I did not find an existing issue matching this YAML export/import round-trip failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingideIssues related to IDEvalidValid issue

    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