@@ -90,19 +90,17 @@ describe("pending context handoff", () => {
9090 expect ( resolvePendingHandoff ( projection , { instanceId : from , model : "source" } , [ ] ) ) . toBeNull ( ) ;
9191 expect ( resolvePendingHandoff ( projection , { instanceId : from , model : "other" } , [ ] ) ) . toBeNull ( ) ;
9292 } ) ;
93- it ( "stays hidden until the thread shows conversation" , ( ) => {
94- const withoutMessages = { ...projection , visibleTurnItems : [ ] } ;
95- expect (
96- resolvePendingHandoff ( withoutMessages , { instanceId : to , model : "first" } , [ ] ) ,
97- ) . toBeNull ( ) ;
98- // A wake run starts with a notification instead of a user message.
99- const wakeOnly = {
93+ it ( "stays hidden while the thread's timeline is empty" , ( ) => {
94+ const empty = { ...projection , visibleTurnItems : [ ] } ;
95+ expect ( resolvePendingHandoff ( empty , { instanceId : to , model : "first" } , [ ] ) ) . toBeNull ( ) ;
96+ // Paging can leave a window of only tool rows after the prompt.
97+ const toolRowsOnly = {
10098 ...projection ,
101- visibleTurnItems : [ { item : { type : "notification " } } ] ,
99+ visibleTurnItems : [ { item : { type : "command_execution " } } ] ,
102100 } as unknown as OrchestrationV2ThreadProjection ;
103- expect ( resolvePendingHandoff ( wakeOnly , { instanceId : to , model : "first" } , [ ] ) ?. to . model ) . toBe (
104- "first" ,
105- ) ;
101+ expect (
102+ resolvePendingHandoff ( toolRowsOnly , { instanceId : to , model : "first" } , [ ] ) ?. to . model ,
103+ ) . toBe ( "first" ) ;
106104 } ) ;
107105 it ( "only previews a same-provider model change when it needs a fresh native thread" , ( ) => {
108106 const providers = [
0 commit comments