Skip to content

[BUG] ChatGPT Import Fails on Conversations with Null Titles #451

Closed

Description

@jrand0m

Bug Description
ChatGPT importer crashes when encountering conversations with null titles in conversations.json, causing entire import to fail.

Steps To Reproduce

  1. Export ChatGPT conversations to conversations.json
  2. Ensure some conversations have "title": null in JSON
  3. Run bm import chatgpt conversations.json --project Life
  4. Import fails with TypeError: expected string or bytes-like object, got 'NoneType'

Expected Behavior

  • Skip conversations with null titles with warning message
  • Continue importing valid conversations
  • Report summary: "X imported, Y skipped"

Actual Behavior

  • Entire import fails on first null title
  • No conversations imported
  • Traceback shown instead of graceful handling

Error Stack

File ".../chatgpt_importer.py", line 97, in _format_chat_content
    clean_title = clean_filename(conversation["title"])
File ".../utils.py", line 18, in clean_filename
    name = re.sub(r"[\s\-,.:/\\\[\]\(\)]+", "_", name)
TypeError: expected string or bytes-like object, got 'NoneType'

Root Cause
clean_filename() doesn't validate input before regex operation

Environment

  • OS: macOS
  • Python version: 3.12.12
  • Basic Memory version: 0.16.2
  • Installation method: uv
  • Data source: ChatGPT export

Activity

  1. added
    bug
    on Dec 11, 2025
  2. added a commit that references this issue on Dec 24, 2025
    ba45a39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions