@@ -6,13 +6,7 @@ import { createServer } from 'net';
66import { Buffer } from 'node:buffer' ;
77import { status } from './api' ;
88import { Client , createClient , createConfig } from './api/client' ;
9- import {
10- buildSandboxSpawn ,
11- ensureProxy ,
12- stopProxy ,
13- isSandboxEnabled ,
14- isSandboxAvailable ,
15- } from './sandbox' ;
9+
1610
1711export interface Logger {
1812 info : ( ...args : unknown [ ] ) => void ;
@@ -232,17 +226,10 @@ export const startGoosed = async (options: StartGoosedOptions): Promise<GoosedRe
232226 } ;
233227 }
234228
235- if ( isSandboxEnabled ( ) && ! isSandboxAvailable ( ) ) {
236- throw new Error ( 'GOOSE_SANDBOX=true but sandbox-exec is not available (macOS only)' ) ;
237- }
238- const useSandbox = isSandboxEnabled ( ) ;
239-
240229 const goosedPath = findGoosedBinaryPath ( { isPackaged, resourcesPath } ) ;
241230
242231 const port = await findAvailablePort ( ) ;
243- logger . info (
244- `Starting goosed from: ${ goosedPath } on port ${ port } in dir ${ workingDir } ${ useSandbox ? ' [SANDBOXED]' : '' } `
245- ) ;
232+ logger . info ( `Starting goosed from: ${ goosedPath } on port ${ port } in dir ${ workingDir } ` ) ;
246233
247234 const baseUrl = `https://127.0.0.1:${ port } ` ;
248235
@@ -257,19 +244,8 @@ export const startGoosed = async (options: StartGoosedOptions): Promise<GoosedRe
257244 }
258245 }
259246
260- // If sandbox mode, start proxy and wrap with sandbox-exec
261- let spawnCommand = goosedPath ;
262- let spawnArgs = [ 'agent' ] ;
263-
264- if ( useSandbox ) {
265- const proxy = await ensureProxy ( ) ;
266- const sandboxSpawn = buildSandboxSpawn ( goosedPath , [ 'agent' ] , proxy . port ) ;
267- spawnCommand = sandboxSpawn . command ;
268- spawnArgs = sandboxSpawn . args ;
269- // Merge proxy env vars into the process env
270- Object . assign ( spawnEnv , sandboxSpawn . env ) ;
271- logger . info ( `[sandbox] Spawning via: ${ spawnCommand } ${ spawnArgs . join ( ' ' ) } ` ) ;
272- }
247+ const spawnCommand = goosedPath ;
248+ const spawnArgs = [ 'agent' ] ;
273249
274250 const isWindows = process . platform === 'win32' ;
275251 const spawnOptions = {
@@ -368,10 +344,6 @@ export const startGoosed = async (options: StartGoosedOptions): Promise<GoosedRe
368344 logger . error ( 'Error while terminating goosed process:' , error ) ;
369345 }
370346
371- if ( useSandbox ) {
372- stopProxy ( ) . catch ( ( err ) => logger . error ( 'Error stopping sandbox proxy:' , err ) ) ;
373- }
374-
375347 setTimeout ( ( ) => {
376348 if ( goosedProcess && ! goosedProcess . killed && process . platform !== 'win32' ) {
377349 goosedProcess . kill ( 'SIGKILL' ) ;
0 commit comments