@@ -80,7 +80,7 @@ function buildMessage(id: string, role: "user" | "assistant", text: string): Wit
8080 }
8181}
8282
83- test ( "chat message transform leaves messages untouched when compress is denied" , async ( ) => {
83+ test ( "chat message transform strips hallucinated tags even when compress is denied" , async ( ) => {
8484 const state = createSessionState ( )
8585 const logger = new Logger ( false )
8686 const config = buildConfig ( "deny" )
@@ -104,7 +104,7 @@ test("chat message transform leaves messages untouched when compress is denied",
104104 await handler ( { } , output )
105105
106106 assert . equal ( output . messages [ 0 ] ?. parts [ 0 ] ?. type , "text" )
107- assert . equal ( ( output . messages [ 0 ] ?. parts [ 0 ] as any ) . text , "alpha <dcp>beta</dcp> omega" )
107+ assert . equal ( ( output . messages [ 0 ] ?. parts [ 0 ] as any ) . text , "alpha omega" )
108108} )
109109
110110test ( "command execute exits after effective permission resolves to deny" , async ( ) => {
@@ -144,11 +144,11 @@ test("chat message hook caches variant even when effective permission is denied"
144144 assert . equal ( state . variant , "danger" )
145145} )
146146
147- test ( "text complete leaves output untouched when compress is denied " , async ( ) => {
147+ test ( "text complete strips hallucinated metadata tags " , async ( ) => {
148148 const output = { text : "alpha <dcp>beta</dcp> omega" }
149- const handler = createTextCompleteHandler ( createSessionState ( ) , buildConfig ( "deny" ) )
149+ const handler = createTextCompleteHandler ( )
150150
151151 await handler ( { sessionID : "session-1" , messageID : "message-1" , partID : "part-1" } , output )
152152
153- assert . equal ( output . text , "alpha <dcp>beta</dcp> omega" )
153+ assert . equal ( output . text , "alpha omega" )
154154} )
0 commit comments