fix: preserve tool-turn context in chat/completions (#14270)#3
Merged
Conversation
added 3 commits
April 23, 2026 12:44
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.
결론
Open WebUI 계열 클라이언트에서 도구 호출 맥락이 다음 턴에 소실되는 문제(NousResearch#14270)를 chat/completions 경로에서 재현 테스트 후 수정했습니다.
원인
/v1/chat/completions파서가user/assistant만 conversation_history에 포함하고toolrole은 버렸습니다.content: ""+tool_calls형태로 전달되면, 이전 턴에 도구를 불렀다는 힌트가 완전히 사라졌습니다.수정 내용
toolrole 메시지를 conversation_history에 포함[assistant issued tool calls: read_file]테스트
test_tool_messages_and_assistant_tool_calls_are_preservedtest_last_user_message_selected_when_trailing_tool_message_existstest_conversation_history_passed회귀 포함실행:
scripts/run_tests.sh tests/gateway/test_api_server.py::TestChatCompletionsEndpoint결과:
연계 이슈