fix: ensure @-command UI message ordering and test (#12038)

Co-authored-by: Jack Wotherspoon <jackwoth@google.com>
This commit is contained in:
Aaron Smith
2026-01-23 15:50:45 +00:00
committed by GitHub
parent a270f7caa5
commit 140fba7f53
2 changed files with 96 additions and 7 deletions
+6 -6
View File
@@ -491,6 +491,12 @@ export const useGeminiStream = (
// Handle @-commands (which might involve tool calls)
if (isAtCommand(trimmedQuery)) {
// Add user's turn before @ command processing for correct UI ordering.
addItem(
{ type: MessageType.USER, text: trimmedQuery },
userMessageTimestamp,
);
const atCommandResult = await handleAtCommand({
query: trimmedQuery,
config,
@@ -500,12 +506,6 @@ export const useGeminiStream = (
signal: abortSignal,
});
// Add user's turn after @ command processing is done.
addItem(
{ type: MessageType.USER, text: trimmedQuery },
userMessageTimestamp,
);
if (atCommandResult.error) {
onDebugMessage(atCommandResult.error);
return { queryToSend: null, shouldProceed: false };