@@ -13,7 +13,7 @@ import { loadChatHistory, type ChatHistoryResult, type ChatState } from "./chat-
1313import {
1414 excludeComposerAttachments ,
1515 removeQueuedMessageWithoutReleasing ,
16- syncChatQueueFromStoredOutbox ,
16+ syncVisibleChatQueueProjection ,
1717 updateQueuedMessageForSession ,
1818} from "./chat-queue.ts" ;
1919import type { ChatHost } from "./chat-send-contract.ts" ;
@@ -184,7 +184,7 @@ async function readCurrentStoredChatHistory(
184184 if ( ! currentOutbox || ! currentItem || ! sameQueuedDeliveryVersion ( currentItem , item ) ) {
185185 return "continue" ;
186186 }
187- syncChatQueueFromStoredOutbox ( host , currentOutbox ) ;
187+ syncVisibleChatQueueProjection ( host ) ;
188188 if ( chatMessagesContainQueuedSend ( history . messages , item ) ) {
189189 // Server history owns the turn, but the visible transcript may not have
190190 // reloaded yet; materialize the turn locally before dropping the queue row
@@ -293,7 +293,7 @@ async function drainStoredChatOutbox(
293293 return "empty" ;
294294 }
295295 if ( item . sendState === "unconfirmed" || item . sendState === "waiting-model" ) {
296- syncChatQueueFromStoredOutbox ( host , outbox ) ;
296+ syncVisibleChatQueueProjection ( host ) ;
297297 return "blocked" ;
298298 }
299299 const visible = visibleSessionMatches ( host , outbox . sessionKey , outbox . agentId ) ;
@@ -303,7 +303,7 @@ async function drainStoredChatOutbox(
303303 lane . pendingOptions . delete ( item . id ) ;
304304 return "blocked" ;
305305 }
306- syncChatQueueFromStoredOutbox ( host , outbox ) ;
306+ syncVisibleChatQueueProjection ( host ) ;
307307 if ( item . localCommandName === "reset" ) {
308308 const resetText = item . localCommandArgs ? `/reset ${ item . localCommandArgs } ` : "/reset" ;
309309 const convertResetToMessage = ( sendState ?: ChatQueueItem [ "sendState" ] ) =>
@@ -494,7 +494,7 @@ async function drainStoredChatOutbox(
494494 }
495495 }
496496 if ( visible && isChatBusy ( host ) ) {
497- syncChatQueueFromStoredOutbox ( host , outbox ) ;
497+ syncVisibleChatQueueProjection ( host ) ;
498498 updateQueuedMessageForSession ( host , outbox . sessionKey , item . id , ( entry ) => ( {
499499 ...entry ,
500500 sendState : host . connected && host . client ? "waiting-idle" : "waiting-reconnect" ,
@@ -506,7 +506,7 @@ async function drainStoredChatOutbox(
506506 if ( ! currentOutbox || ! currentItem || ! sameQueuedDeliveryVersion ( currentItem , item ) ) {
507507 continue ;
508508 }
509- syncChatQueueFromStoredOutbox ( host , currentOutbox ) ;
509+ syncVisibleChatQueueProjection ( host ) ;
510510 const result = await dependencies . sendQueuedChatMessage (
511511 host ,
512512 item . id ,
0 commit comments