[PR #23525] [CLOSED] fix: handle ChatGPT exports with folder/project entries #66094

Closed
opened 2026-05-06 12:13:52 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/23525
Author: @jjjojoj
Created: 4/9/2026
Status: Closed

Base: devHead: fix/23505-chatgpt-import


📝 Commits (1)

  • 2b7cb47 fix: handle ChatGPT exports with folder/project entries

📊 Changes

1 file changed (+11 additions, -1 deletions)

View changed files

📝 src/lib/utils/index.ts (+11 -1)

📄 Description

Summary

Fixes #23505 — Import of ChatGPT export file results in "Imported 0 Chats".

Root Cause

ChatGPT export files (conversations.json) can include folder and project metadata entries that lack a mapping key. This caused two problems:

  1. getImportOrigin() only checked _chats[0] for the mapping key. If a folder entry appeared first in the array, the export was misidentified as webui format and convertOpenAIChats() was never called — resulting in 0 imports.
  2. convertOpenAIChats() did not skip non-conversation entries, so even when origin detection worked, folder/project entries would fail validation silently.

Changes

  • src/lib/utils/index.tsgetImportOrigin(): Check if any item in the array has a mapping key, instead of only checking _chats[0].
  • src/lib/utils/index.tsconvertOpenAIChats(): Skip entries without a mapping key (folders/projects) before attempting conversion, with a console log for visibility.

Testing

Tested with a ChatGPT export containing both folder entries and conversations — all conversations are now correctly imported.


Contributor License Agreement


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/23525 **Author:** [@jjjojoj](https://github.com/jjjojoj) **Created:** 4/9/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `fix/23505-chatgpt-import` --- ### 📝 Commits (1) - [`2b7cb47`](https://github.com/open-webui/open-webui/commit/2b7cb4784d9db2ed2d7110a1fd22b26f5252f0c4) fix: handle ChatGPT exports with folder/project entries ### 📊 Changes **1 file changed** (+11 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/utils/index.ts` (+11 -1) </details> ### 📄 Description ## Summary Fixes #23505 — Import of ChatGPT export file results in "Imported 0 Chats". ## Root Cause ChatGPT export files (conversations.json) can include folder and project metadata entries that lack a mapping key. This caused two problems: 1. `getImportOrigin()` only checked `_chats[0]` for the mapping key. If a folder entry appeared first in the array, the export was misidentified as webui format and `convertOpenAIChats()` was never called — resulting in 0 imports. 2. `convertOpenAIChats()` did not skip non-conversation entries, so even when origin detection worked, folder/project entries would fail validation silently. ## Changes - `src/lib/utils/index.ts` — `getImportOrigin()`: Check if any item in the array has a mapping key, instead of only checking `_chats[0]`. - `src/lib/utils/index.ts` — `convertOpenAIChats()`: Skip entries without a mapping key (folders/projects) before attempting conversion, with a console log for visibility. ## Testing Tested with a ChatGPT export containing both folder entries and conversations — all conversations are now correctly imported. --- ### Contributor License Agreement - [x] By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-06 12:13:52 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#66094