22import * as NodeFS from "node:fs" ;
33import * as NodePath from "node:path" ;
44
5+ import * as NodeCrypto from "@effect/platform-node/NodeCrypto" ;
56import * as NodeServices from "@effect/platform-node/NodeServices" ;
67import { TRIAGE_PROMPT_FILE_NAME } from "@t3tools/contracts" ;
78import * as NetService from "@t3tools/shared/Net" ;
@@ -24,6 +25,9 @@ const FAILING_AGENT_WINDOWS = `@echo Error: There is not enough space on the dis
2425@exit /b 1
2526` ;
2627
28+ const prependToPath = ( dir : string ) =>
29+ vi . stubEnv ( "PATH" , `${ dir } ${ NodePath . delimiter } ${ process . env . PATH ?? "" } ` ) ;
30+
2731it . live ( "a failed agent launch points at the prompt it could not run" , ( ) =>
2832 Effect . gen ( function * ( ) {
2933 const fs = yield * FileSystem . FileSystem ;
@@ -32,9 +36,7 @@ it.live("a failed agent launch points at the prompt it could not run", () =>
3236 NodeFS . writeFileSync ( NodePath . join ( binDir , "codex" ) , FAILING_AGENT_POSIX , { mode : 0o755 } ) ;
3337 NodeFS . writeFileSync ( NodePath . join ( binDir , "codex.cmd" ) , FAILING_AGENT_WINDOWS ) ;
3438 yield * Effect . acquireRelease (
35- Effect . sync ( ( ) =>
36- vi . stubEnv ( "PATH" , `${ binDir } ${ NodePath . delimiter } ${ process . env . PATH ?? "" } ` ) ,
37- ) ,
39+ Effect . sync ( ( ) => prependToPath ( binDir ) ) ,
3840 ( ) => Effect . sync ( ( ) => vi . unstubAllEnvs ( ) ) ,
3941 ) ;
4042 const previousExitCode = process . exitCode ;
@@ -61,5 +63,9 @@ it.live("a failed agent launch points at the prompt it could not run", () =>
6163 assert . include ( output , promptFilePath ) ;
6264 assert . include ( output , buildTriageLaunchPrompt ( promptFilePath ) ) ;
6365 assert . include ( output , NodePath . join ( NodePath . dirname ( promptFilePath ) , "context.md" ) ) ;
64- } ) . pipe ( Effect . provide ( Layer . mergeAll ( NodeServices . layer , NetService . layer , TestConsole . layer ) ) ) ,
66+ } ) . pipe (
67+ Effect . provide (
68+ Layer . mergeAll ( NodeServices . layer , NodeCrypto . layer , NetService . layer , TestConsole . layer ) ,
69+ ) ,
70+ ) ,
6571) ;
0 commit comments