Skip to content

fix(core):Include all messages in conversation history for OpenAI formatter#844

Open
feelshana wants to merge 1 commit intoagentscope-ai:mainfrom
feelshana:develop-1.1.0
Open

fix(core):Include all messages in conversation history for OpenAI formatter#844
feelshana wants to merge 1 commit intoagentscope-ai:mainfrom
feelshana:develop-1.1.0

Conversation

@feelshana
Copy link
Contributor

@feelshana feelshana commented Feb 28, 2026

AgentScope-Java Version

main

Description

When using agent.call() without parameters, the OpenAIConversationMerger was
excluding the last message from the history and treating it as the current turn.
This caused the LLM to misunderstand the conversation context because the
message sequence was incomplete.
1654

The lastMessage:3号:[3号发言]过,我不知道
is not in history,
Agent 2 is confused. It thinks it is Agent 3.

Modified OpenAIConversationMerger.mergeToUserMessage() to merge ALL messages
into the conversation history (similar to DashScopeConversationMerger),
instead of separating the last message as the current turn.
Always, For single-turn user queries, omitting the prefix makes it look like a standard chat request.

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has been formatted with mvn spotless:apply
  • All tests are passing (mvn test)
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated (e.g. links, examples, etc.)
  • Code is ready for review

@feelshana feelshana requested a review from a team February 28, 2026 07:33
@gemini-code-assist
Copy link

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@codecov
Copy link

codecov bot commented Feb 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant