@@ -206,6 +206,18 @@ describe("CodexAppServerEventProjector commentary projection", () => {
206206 it ( "streams commentary agent messages as keyed progress events" , async ( ) => {
207207 const onAgentEvent = vi . fn ( ) ;
208208 const onPartialReply = vi . fn ( ) ;
209+ const commentaryText = [
210+ "Checking the app-server stream" ,
211+ "" ,
212+ "| Intent | Command |" ,
213+ "| --- | --- |" ,
214+ "| Session only | `/model opus` |" ,
215+ "" ,
216+ "```text" ,
217+ "BEFORE /model opus → persistent" ,
218+ "AFTER /model opus → session only" ,
219+ "```" ,
220+ ] . join ( "\n" ) ;
209221 const projector = await createProjector ( {
210222 ...( await createParams ( ) ) ,
211223 onAgentEvent,
@@ -224,15 +236,15 @@ describe("CodexAppServerEventProjector commentary projection", () => {
224236 ) ;
225237 await projector . handleNotification ( agentMessageDelta ( "Checking" , "msg-commentary" ) ) ;
226238 await projector . handleNotification (
227- agentMessageDelta ( " the app-server stream" , "msg-commentary" ) ,
239+ agentMessageDelta ( commentaryText . slice ( "Checking" . length ) , "msg-commentary" ) ,
228240 ) ;
229241 await projector . handleNotification (
230242 turnCompleted ( [
231243 {
232244 type : "agentMessage" ,
233245 id : "msg-commentary" ,
234246 phase : "commentary" ,
235- text : "Checking the app-server stream" ,
247+ text : commentaryText ,
236248 } ,
237249 {
238250 type : "agentMessage" ,
@@ -262,7 +274,7 @@ describe("CodexAppServerEventProjector commentary projection", () => {
262274 kind : "preamble" ,
263275 title : "Preamble" ,
264276 phase : "update" ,
265- progressText : "Checking the app-server stream" ,
277+ progressText : commentaryText ,
266278 source : "codex-app-server" ,
267279 } ,
268280 ] ) ;
@@ -276,9 +288,9 @@ describe("CodexAppServerEventProjector commentary projection", () => {
276288 ) ;
277289 expect ( commentary ) . toMatchObject ( {
278290 role : "assistant" ,
279- content : [ { type : "text" , text : "Checking the app-server stream" } ] ,
291+ content : [ { type : "text" , text : commentaryText } ] ,
280292 openclawStreamFallback : {
281- replacementText : "Checking the app-server stream" ,
293+ replacementText : commentaryText ,
282294 source : "segment" ,
283295 itemId : "msg-commentary" ,
284296 } ,
0 commit comments