@@ -21,12 +21,17 @@ final class AppModel: ObservableObject {
2121 // so they never freeze the main actor / menu.
2222 private let controlQueue = DispatchQueue ( label: " newbro.ui.control " )
2323
24+ /// Login-shell PATH so node subprocesses (and the `node`-based `codex`
25+ /// they exec) resolve under the app's otherwise-minimal launchd env.
26+ private let childEnv = RuntimeLocator . childEnvironment ( )
27+
2428 init ( ) {
2529 let loc = locator
30+ let env = RuntimeLocator . childEnvironment ( )
2631 self . loginItem = LoginItem ( appPath: Bundle . main. bundlePath)
2732 self . supervisor = ProfileSupervisor (
2833 processFactory: . init( make: { argv, onLine, onExit in
29- NodeProcess ( argv: argv, onLine: onLine, onExit: onExit)
34+ NodeProcess ( argv: argv, environment : env , onLine: onLine, onExit: onExit)
3035 } ) ,
3136 argvBuilder: { profile in
3237 loc. nodeArgv ( for: profile) ?? [ ]
@@ -102,6 +107,7 @@ final class AppModel: ObservableObject {
102107 let argv = locator. installCommandArgv ( )
103108 updateInstallProcess = NodeProcess (
104109 argv: argv,
110+ environment: childEnv,
105111 onLine: { _ in } ,
106112 onExit: { [ weak self] code in
107113 Task { @MainActor in
@@ -213,6 +219,7 @@ final class AppModel: ObservableObject {
213219 // Retain the process; otherwise it is deallocated before it runs.
214220 installProcess = NodeProcess (
215221 argv: argv,
222+ environment: childEnv,
216223 onLine: { [ weak self] line in
217224 Task { @MainActor in self ? . installLog += line + " \n " }
218225 } ,
0 commit comments