@@ -1856,52 +1856,75 @@ it.layer(NodeServices.layer)("AgentSessionScanner", (it) => {
18561856 } ) ,
18571857 ) ;
18581858
1859- it . effect ( "imports a Codex prompt whose inline image exceeds the history budget" , ( ) =>
1860- Effect . gen ( function * ( ) {
1861- const path = yield * Path . Path ;
1862- const nowMs = Date . parse ( "2026-08-24T12:00:00.000Z" ) ;
1863- yield * TestClock . setTime ( nowMs ) ;
1864- const claudeHomePath = yield * makeTempDir ( "t3code-claude-home-" ) ;
1865- const codexHomePath = yield * makeTempDir ( "t3code-codex-home-" ) ;
1866- const workspace = yield * makeTempDir ( "t3code-workspace-" ) ;
1867- yield * writeTranscript ( {
1868- filePath : path . join ( codexHomePath , "sessions" , "2026" , "08" , "24" , "rollout-image.jsonl" ) ,
1869- contents : [
1870- encodeTranscriptRecord ( {
1871- type : "session_meta" ,
1872- payload : { id : "image-session" , cwd : workspace } ,
1873- } ) ,
1874- encodeTranscriptRecord ( {
1875- type : "event_msg" ,
1876- payload : {
1877- type : "user_message" ,
1878- message : "Describe this screenshot" ,
1879- images : [ `data:image/png;base64,${ "A" . repeat ( 17 * 1024 * 1024 ) } ` ] ,
1880- } ,
1881- } ) ,
1882- encodeTranscriptRecord ( {
1883- type : "response_item" ,
1884- payload : {
1885- type : "message" ,
1886- role : "assistant" ,
1887- content : [ { type : "output_text" , text : "A login form." } ] ,
1888- } ,
1889- } ) ,
1890- ] . join ( "\n" ) ,
1891- mtimeMs : nowMs ,
1892- } ) ;
1859+ it . effect (
1860+ "imports an image-only Codex prompt whose inline image exceeds the history budget" ,
1861+ ( ) =>
1862+ Effect . gen ( function * ( ) {
1863+ const path = yield * Path . Path ;
1864+ const nowMs = Date . parse ( "2026-08-24T12:00:00.000Z" ) ;
1865+ yield * TestClock . setTime ( nowMs ) ;
1866+ const claudeHomePath = yield * makeTempDir ( "t3code-claude-home-" ) ;
1867+ const codexHomePath = yield * makeTempDir ( "t3code-codex-home-" ) ;
1868+ const workspace = yield * makeTempDir ( "t3code-workspace-" ) ;
1869+ const context = "<environment_context>\n<cwd>/tmp/project</cwd>\n</environment_context>" ;
1870+ const image = `data:image/png;base64,${ "A" . repeat ( 17 * 1024 * 1024 ) } ` ;
1871+ yield * writeTranscript ( {
1872+ filePath : path . join (
1873+ codexHomePath ,
1874+ "sessions" ,
1875+ "2026" ,
1876+ "08" ,
1877+ "24" ,
1878+ "rollout-image.jsonl" ,
1879+ ) ,
1880+ contents : [
1881+ encodeTranscriptRecord ( {
1882+ type : "session_meta" ,
1883+ payload : { id : "image-session" , cwd : workspace } ,
1884+ } ) ,
1885+ encodeTranscriptRecord ( {
1886+ type : "response_item" ,
1887+ payload : {
1888+ type : "message" ,
1889+ role : "user" ,
1890+ content : [ { type : "input_text" , text : context } ] ,
1891+ } ,
1892+ } ) ,
1893+ encodeTranscriptRecord ( {
1894+ type : "event_msg" ,
1895+ payload : { type : "user_message" , message : "" , images : [ image ] , local_images : [ ] } ,
1896+ } ) ,
1897+ encodeTranscriptRecord ( {
1898+ type : "response_item" ,
1899+ payload : {
1900+ type : "message" ,
1901+ role : "user" ,
1902+ content : [ { type : "input_image" , image_url : image } ] ,
1903+ } ,
1904+ } ) ,
1905+ encodeTranscriptRecord ( {
1906+ type : "response_item" ,
1907+ payload : {
1908+ type : "message" ,
1909+ role : "assistant" ,
1910+ content : [ { type : "output_text" , text : "A login form." } ] ,
1911+ } ,
1912+ } ) ,
1913+ ] . join ( "\n" ) ,
1914+ mtimeMs : nowMs ,
1915+ } ) ;
18931916
1894- const threads = yield * runRecentThreads ( {
1895- claudeHomePath,
1896- codexHomePath,
1897- workspaceRoot : workspace ,
1898- } ) ;
1917+ const threads = yield * runRecentThreads ( {
1918+ claudeHomePath,
1919+ codexHomePath,
1920+ workspaceRoot : workspace ,
1921+ } ) ;
18991922
1900- expect ( threads [ 0 ] ?. messages . map ( ( message ) => message . text ) ) . toEqual ( [
1901- "Describe this screenshot" ,
1902- "A login form." ,
1903- ] ) ;
1904- } ) ,
1923+ expect ( threads [ 0 ] ?. messages . map ( ( message ) => message . text ) ) . toEqual ( [
1924+ context ,
1925+ "A login form." ,
1926+ ] ) ;
1927+ } ) ,
19051928 ) ;
19061929
19071930 it . effect ( "suppresses duplicate session copies without reporting a skipped import" , ( ) =>
@@ -3381,6 +3404,16 @@ describe("parseAgentSessionTranscript", () => {
33813404 item : { type : "UserMessage" , content : [ { type : "text" , text : "Ship it" } ] } ,
33823405 } ,
33833406 } ) ,
3407+ assistant ( "Shipped." ) ,
3408+ responseUser ( "Review the old code" ) ,
3409+ encodeTranscriptRecord ( { type : "event_msg" , payload : { type : "turn_aborted" } } ) ,
3410+ encodeTranscriptRecord ( { type : "event_msg" , payload : { type : "task_started" } } ) ,
3411+ encodeTranscriptRecord ( {
3412+ type : "event_msg" ,
3413+ payload : { type : "user_message" , message : "Review the new code" } ,
3414+ } ) ,
3415+ responseUser ( "Review the new code" ) ,
3416+ assistant ( "Done" ) ,
33843417 ] . join ( "\n" ) ,
33853418 source : "codex" ,
33863419 providerInstanceId : ProviderInstanceId . make ( "codex" ) ,
@@ -3399,6 +3432,10 @@ describe("parseAgentSessionTranscript", () => {
33993432 "[Image #1]" ,
34003433 "Nice screenshot." ,
34013434 "Ship it" ,
3435+ "Shipped." ,
3436+ "Review the old code" ,
3437+ "Review the new code" ,
3438+ "Done" ,
34023439 ] ) ;
34033440 } ) ;
34043441
0 commit comments