Repository navigation
Studio: import ShareGPT chats with the right roles - #11149
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Review + UI evidencePinned head: I imported the same ShareGPT JSONL file through Projects > Import chats on two Studio builds, one from the merge base File
Unit test A/B, running the PR's
Conclusion: Before the fix, importing a |
|
Confirmed this hits chat-import.ts where any |
1 similar comment
|
Confirmed this hits chat-import.ts where any |
|
@codex review |
1 similar comment
|
@codex review |
* Studio: map ShareGPT user/assistant roles on chat import * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Lyxot <[email protected]>

Importing a ShareGPT file only recognised from: "human" and "system". Anything else, including "user", became an assistant message, so the whole chat looked like the model talking to itself.
The import now trims and lowercases the from value and maps human and user to user, gpt and assistant to assistant, and system to system. Unknown values still become assistant as before.
Tested with a new unit test and by importing user/assistant, human/gpt and mixed case files through Projects > Import chats. Roles are correct on screen and in the saved thread.