mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 04:30:48 +00:00
fix(cli): ensure correct ordering of hook system messages and AI responses
Commit pending AI response before adding HookSystemMessage to history to prevent "Stop says:" block from appearing above the AI's reply.
This commit is contained in:
parent
76e52a51db
commit
7c1fe2d938
1 changed files with 5 additions and 0 deletions
|
|
@ -1101,6 +1101,11 @@ export const useGeminiStream = (
|
|||
break;
|
||||
case ServerGeminiEventType.HookSystemMessage:
|
||||
// Display system message from Stop hooks with "Stop says:" prefix
|
||||
// First commit any pending AI response to ensure correct ordering
|
||||
if (pendingHistoryItemRef.current) {
|
||||
addItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
||||
setPendingHistoryItem(null);
|
||||
}
|
||||
addItem(
|
||||
{
|
||||
type: 'stop_hook_system_message',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue