@@ -265,64 +265,6 @@ describe("MobileChatSurface", () => {
265265 await screen . findByText ( "Done from terminal" ) ;
266266 } ) ;
267267
268- it ( "polls Claude history for a terminal-routed run while the agent is working" , async ( ) => {
269- vi . mocked ( attachWorktreeConversation ) . mockResolvedValue ( createConversationResponse ( "claudeCode" ) ) ;
270- vi . mocked ( fetchWorktreeConversationHistory ) . mockResolvedValue ( createConversationResponse ( "claudeCode" , {
271- messages : [
272- {
273- id : "ask-1" ,
274- turnId : "turn-1" ,
275- order : 0 ,
276- role : "assistant" ,
277- kind : "toolUse" ,
278- toolName : "AskUserQuestion" ,
279- toolCallId : "ask-1" ,
280- text : JSON . stringify ( {
281- questions : [
282- {
283- question : "Cats or dogs?" ,
284- header : "Pet type" ,
285- multiSelect : false ,
286- options : [ { label : "Cats" } , { label : "Dogs" } ] ,
287- } ,
288- ] ,
289- } ) ,
290- status : "completed" ,
291- createdAt : "2026-05-28T10:00:00.000Z" ,
292- } ,
293- ] ,
294- } ) ) ;
295-
296- render ( MobileChatSurface , {
297- props : {
298- worktree : createWorktree ( { agent : "working" } ) ,
299- } ,
300- } ) ;
301-
302- await vi . advanceTimersByTimeAsync ( 1000 ) ;
303-
304- await waitFor ( ( ) => {
305- expect ( fetchWorktreeConversationHistory ) . toHaveBeenCalledWith ( "feature/mobile-chat" ) ;
306- } ) ;
307- await screen . findByRole ( "button" , { name : "Cats" } ) ;
308- } ) ;
309-
310- it ( "does not poll history for an idle Claude worktree on mount" , async ( ) => {
311- vi . mocked ( attachWorktreeConversation ) . mockResolvedValue ( createConversationResponse ( "claudeCode" ) ) ;
312- vi . mocked ( fetchWorktreeConversationHistory ) . mockResolvedValue ( createConversationResponse ( "claudeCode" ) ) ;
313-
314- render ( MobileChatSurface , {
315- props : {
316- worktree : createWorktree ( { agent : "waiting" } ) ,
317- } ,
318- } ) ;
319-
320- await screen . findByText ( "No messages yet. Send the first prompt to start this chat." ) ;
321- await vi . advanceTimersByTimeAsync ( 3000 ) ;
322-
323- expect ( fetchWorktreeConversationHistory ) . not . toHaveBeenCalled ( ) ;
324- } ) ;
325-
326268 it ( "does not poll Codex history after sending when the websocket stream is active" , async ( ) => {
327269 vi . mocked ( attachWorktreeConversation ) . mockResolvedValue ( createConversationResponse ( "codexAppServer" ) ) ;
328270 vi . mocked ( sendWorktreeConversationMessage ) . mockResolvedValue ( {
0 commit comments