@@ -79,8 +79,8 @@ describe("prompt queue TUI smoke (serve + script)", () => {
7979
8080 yield * Effect . sleep ( "150 millis" )
8181
82- const script = yield * Effect . tryPromise ( ( ) =>
83- Bun . spawn ( [ "bash" , scriptPath ] , {
82+ const script = yield * Effect . tryPromise ( async ( ) => {
83+ const child = Bun . spawn ( [ "bash" , scriptPath ] , {
8484 cwd : home ,
8585 env : {
8686 ...process . env ,
@@ -89,13 +89,21 @@ describe("prompt queue TUI smoke (serve + script)", () => {
8989 OPENCODE_SESSION_ID : sessionID ,
9090 OPENCODE_ARTIFACT_DIR : artifactDir ,
9191 OPENCODE_QUEUE_ONLY : "1" ,
92+ OPENCODE_EDIT_FIRST : "1" ,
9293 OPENCODE_CLI_ENTRY : path . join ( opencodeRoot , "src/index.ts" ) ,
9394 } ,
9495 stdout : "pipe" ,
9596 stderr : "pipe" ,
96- } ) . exited ,
97- )
98- expect ( script ) . toBe ( 0 )
97+ } )
98+ const [ exitCode , stdout , stderr ] = await Promise . all ( [
99+ child . exited ,
100+ new Response ( child . stdout ) . text ( ) ,
101+ new Response ( child . stderr ) . text ( ) ,
102+ ] )
103+ return { exitCode, stdout, stderr }
104+ } )
105+ if ( script . exitCode !== 0 ) throw new Error ( `queue smoke failed\n${ script . stderr } \n${ script . stdout } ` )
106+ expect ( script . exitCode ) . toBe ( 0 )
99107
100108 yield * Deferred . succeed ( gate , void 0 )
101109
@@ -107,7 +115,7 @@ describe("prompt queue TUI smoke (serve + script)", () => {
107115
108116 const inputs = yield * llm . inputs
109117 expect ( inputs ) . toHaveLength ( 4 )
110- expect ( JSON . stringify ( inputs [ 1 ] ?. messages ) ) . toContain ( "queue-one" )
118+ expect ( JSON . stringify ( inputs [ 1 ] ?. messages ) ) . toContain ( "queue-one-edited " )
111119 expect ( JSON . stringify ( inputs [ 1 ] ?. messages ) ) . not . toContain ( "queue-two" )
112120 expect ( JSON . stringify ( inputs [ 2 ] ?. messages ) ) . toContain ( "queue-two" )
113121 expect ( JSON . stringify ( inputs [ 2 ] ?. messages ) ) . not . toContain ( "queue-three" )
@@ -116,6 +124,9 @@ describe("prompt queue TUI smoke (serve + script)", () => {
116124 const queued = yield * Effect . tryPromise ( ( ) => readFile ( path . join ( artifactDir , "queued.txt" ) , "utf8" ) )
117125 expect ( queued . trim ( ) ) . toBe ( "queued" )
118126
127+ const edited = yield * Effect . tryPromise ( ( ) => readFile ( path . join ( artifactDir , "edited.txt" ) , "utf8" ) )
128+ expect ( edited . trim ( ) ) . toBe ( "queue-one-edited" )
129+
119130 const attach = yield * Effect . tryPromise ( ( ) =>
120131 readFile ( path . join ( artifactDir , "tui-attach.txt" ) , "utf8" ) . catch ( ( ) => "attach skipped" ) ,
121132 )
0 commit comments