@@ -36,7 +36,18 @@ let messageRows: Array<{ parts: unknown; role: string; createdAt: Date }> = [
3636 parts : {
3737 id : "m1" ,
3838 role : "user" ,
39- parts : [ { type : "text" , text : "Please debug the flaky tests." } ] ,
39+ parts : [
40+ { type : "text" , text : "Please debug the flaky tests." } ,
41+ {
42+ type : "data-snippet" ,
43+ id : "snippet-1" ,
44+ data : {
45+ filename : "logs/test-output.txt" ,
46+ content :
47+ " FAIL tests/flaky.test.ts\nExpected 200 but received 500" ,
48+ } ,
49+ } ,
50+ ] ,
4051 } ,
4152 role : "user" ,
4253 createdAt : new Date ( "2025-01-01T12:00:00Z" ) ,
@@ -118,7 +129,18 @@ describe("GET /api/shared/:shareId/markdown", () => {
118129 parts : {
119130 id : "m1" ,
120131 role : "user" ,
121- parts : [ { type : "text" , text : "Please debug the flaky tests." } ] ,
132+ parts : [
133+ { type : "text" , text : "Please debug the flaky tests." } ,
134+ {
135+ type : "data-snippet" ,
136+ id : "snippet-1" ,
137+ data : {
138+ filename : "logs/test-output.txt" ,
139+ content :
140+ " FAIL tests/flaky.test.ts\nExpected 200 but received 500" ,
141+ } ,
142+ } ,
143+ ] ,
122144 } ,
123145 role : "user" ,
124146 createdAt : new Date ( "2025-01-01T12:00:00Z" ) ,
@@ -187,6 +209,9 @@ describe("GET /api/shared/:shareId/markdown", () => {
187209 expect ( body ) . toContain ( "pr_number: 123" ) ;
188210 expect ( body ) . toContain ( 'created_at: "2025-01-01T12:00:00.000Z"' ) ;
189211 expect ( body ) . toContain ( "## User\nPlease debug the flaky tests." ) ;
212+ expect ( body ) . toContain (
213+ '<snippet filename="logs/test-output.txt">\n FAIL tests/flaky.test.ts\nExpected 200 but received 500\n</snippet>' ,
214+ ) ;
190215 expect ( body ) . toContain ( "<!-- tool_activity: duration=15m tool_calls=2 -->" ) ;
191216 expect ( body ) . toContain ( "## Assistant\nI fixed the timeout handling." ) ;
192217 expect ( body ) . not . toContain ( "README.md" ) ;
0 commit comments