fix(legacy): preserve chat prompt roles - #1410
Draft
yaodong-shen wants to merge 1 commit into
Draft
Conversation
yaodong-shen
force-pushed
the
fix/1234-preserve-chat-roles
branch
from
August 19, 2026 06:33
e73a2a9 to
f956727
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root cause
The OpenAI and VLLM API paths converted
List[Dict]chat prompts to a single string before dispatch. That turned role markers into user content; GPT-5 additionally discarded prior assistant turns when forming a Responses request.Validation
PYTHONPATH=/private/tmp/autorag-test-stubs uv run --no-sync pytest tests/autorag/nodes/generator/test_openai.py tests/autorag/nodes/generator/test_minimax.py tests/autorag/nodes/generator/test_vllm_api.py -q -k 'truncate_chat_prompt_preserves_message_roles or gpt_5_responses_preserve_full_chat_history or truncate_messages_preserves_roles or vllm_api_truncate_preserves_chat_messages'uvx ruff checkon all changed generator and test filesuvx ruff format --checkon all changed generator and test filesgit diff --checkThe full legacy suite was not runnable locally because its macOS ARM development resolution includes an NVIDIA-only package and its OpenAI test module imports optional
torch.cudaduring collection. The focused regression tests use no model call, credentials, or GPU.Closes #1234