@@ -56,6 +56,8 @@ export const composerSessionAdmissionScenario = {
5656 const body = route . request ( ) . postDataJSON ( ) ;
5757 posts . push ( body . message ) ;
5858 const queuedTurnId = `${ turnId } -queued-${ posts . length } ` ;
59+ page . __loopxRuntime . messages . get ( sessionId ) . push ( { message_id : `${ queuedTurnId } -user` , turn_id : queuedTurnId ,
60+ role : "user" , text : body . message , created_at : "2026-08-13T01:00:01Z" } ) ;
5961 // A queued follow-up waits behind the running Turn; its stream is held too.
6062 routes . push ( `**/api/chat/sessions/${ sessionId } /turns/${ queuedTurnId } /events` ) ;
6163 await page . route ( routes . at ( - 1 ) , ( held ) => { heldEvents . push ( held ) ; } ) ;
@@ -84,10 +86,14 @@ export const composerSessionAdmissionScenario = {
8486 const body = route . request ( ) . postDataJSON ( ) ;
8587 const target = new URL ( route . request ( ) . url ( ) ) . pathname . split ( "/" ) [ 6 ] ;
8688 adjustments . push ( { ...body , turnId : target } ) ;
87- if ( [ 1 , 6 ] . includes ( adjustments . length ) ) return route . fulfill ( { status : 409 , json : { ok : false , error : "接收状态未确认" } } ) ;
89+ if ( adjustments . length === 9 ) {
90+ page . __loopxRuntime . messages . get ( sessionId ) . push ( { message_id : "stored-current-page" , turn_id : target ,
91+ role : "user" , text : body . message , created_at : "2026-08-13T01:00:02Z" } ) ;
92+ }
93+ if ( [ 1 , 6 , 9 ] . includes ( adjustments . length ) ) return route . fulfill ( { status : 409 , json : { ok : false , error : "接收状态未确认" } } ) ;
8894 if ( adjustments . length === 4 ) return route . fulfill ( { status : 409 , json : { ok : false , error : "本次未送达" , delivery_state : "not_delivered" } } ) ;
8995 const receipt = { ok : true , session_id : sessionId , turn_id : adjustments . length === 2 ? "wrong-turn" : target ,
90- client_ingress_id : body . client_ingress_id , status : "delivered" , created : adjustments . length !== 7 } ;
96+ client_ingress_id : body . client_ingress_id , status : "delivered" , created : ! [ 7 , 10 ] . includes ( adjustments . length ) } ;
9197 if ( adjustments . length === 3 ) { delayedReceipt = ( ) => route . fulfill ( { json : receipt } ) ; return ; }
9298 await route . fulfill ( { json : receipt } ) ;
9399 } ) ;
@@ -165,6 +171,20 @@ export const composerSessionAdmissionScenario = {
165171 || adjustments [ 7 ] . turnId === managed . turnId || await composerInput . inputValue ( ) ) {
166172 throw new Error ( "Instructions during the original send started new work or failed to clear the submitted draft" ) ;
167173 }
174+ // Without reloading, a delivered replay must fetch the new stored message,
175+ // not reuse the history snapshot taken before the instruction was sent.
176+ const currentPageInstruction = "问卷里补上使用频率。" ;
177+ await composerInput . fill ( currentPageInstruction ) ;
178+ await sendButton . click ( ) ;
179+ await page . getByRole ( "status" ) . filter ( { hasText : "接收状态未确认" } ) . waitFor ( ) ;
180+ await sendButton . click ( ) ;
181+ await page . getByRole ( "status" ) . filter ( { hasText : "执行器已接收本轮追加指令" } ) . waitFor ( ) ;
182+ const currentPageStored = page . locator ( ".personal-message" ) . getByText ( currentPageInstruction , { exact : true } ) ;
183+ await currentPageStored . waitFor ( { timeout : 5000 } ) ;
184+ if ( await currentPageStored . count ( ) !== 1 || adjustments . length !== 10
185+ || adjustments [ 8 ] . client_ingress_id !== adjustments [ 9 ] . client_ingress_id || managed . posts . length !== 1 ) {
186+ throw new Error ( "Delivered replay did not read back one stored instruction on the current page" ) ;
187+ }
168188 await managed . release ( ) ;
169189 notes . push ( "managed Codex: ordinary composer steers its exact Turn while the original send waits, retaining drafts and retry identity, including after completion and reload; restored requests never dispatch automatically" ) ;
170190
@@ -174,7 +194,7 @@ export const composerSessionAdmissionScenario = {
174194 if ( ! await sendButton . isDisabled ( ) ) throw new Error ( "Unsupported executor was offered native steering" ) ;
175195 await sendButton . click ( { force : true } ) ;
176196 await page . waitForTimeout ( 100 ) ;
177- if ( unsupported . posts . length || adjustments . length !== 8 ) throw new Error ( "Unsupported executor received an effect" ) ;
197+ if ( unsupported . posts . length || adjustments . length !== 10 ) throw new Error ( "Unsupported executor received an effect" ) ;
178198 await composerInput . fill ( "" ) ;
179199 await unsupported . release ( ) ;
180200 notes . push ( "unsupported managed adapter: draft retained and no Turn or steering effect" ) ;
0 commit comments