Skip to content

Commit 02af8b4

Browse files
authored
Omit cwd from Codex MCP config to fix Sail and worktree issues (#809)
1 parent 233588d commit 02af8b4

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

config/boost.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
'composer' => env('BOOST_COMPOSER_EXECUTABLE_PATH'),
4747
'npm' => env('BOOST_NPM_EXECUTABLE_PATH'),
4848
'vendor_bin' => env('BOOST_VENDOR_BIN_EXECUTABLE_PATH'),
49-
'current_directory' => env('BOOST_CURRENT_DIRECTORY_EXECUTABLE_PATH', base_path()),
49+
'current_directory' => env('BOOST_CURRENT_DIRECTORY_EXECUTABLE_PATH'),
5050
],
5151

5252
];

src/Install/Agents/Codex.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function mcpServerConfig(string $command, array $args = [], array $env =
7777
return collect([
7878
'command' => $command,
7979
'args' => $args,
80-
'cwd' => config('boost.executable_paths.current_directory', base_path()),
80+
'cwd' => config('boost.executable_paths.current_directory'),
8181
'env' => $env,
8282
])->filter(fn ($value): bool => ! in_array($value, [[], null, ''], true))
8383
->toArray();

tests/Unit/Install/Agents/CodexTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@
4747
expect($codex->mcpConfigKey())->toBe('mcp_servers');
4848
});
4949

50-
test('builds MCP server config with cwd field', function (): void {
50+
test('builds MCP server config without cwd by default', function (): void {
5151
$codex = new Codex($this->strategyFactory);
5252

5353
$config = $codex->mcpServerConfig('php', ['artisan', 'boost:mcp']);
5454

5555
expect($config)->toHaveKey('command', 'php')
5656
->toHaveKey('args', ['artisan', 'boost:mcp'])
57-
->toHaveKey('cwd', base_path());
57+
->not->toHaveKey('cwd');
5858
});
5959

6060
test('builds MCP server config with config "boost.executable_paths.current_directory" override', function (): void {
@@ -76,7 +76,7 @@
7676

7777
expect($config)->toHaveKey('command', 'php')
7878
->toHaveKey('args', ['artisan'])
79-
->toHaveKey('cwd')
79+
->not->toHaveKey('cwd')
8080
->toHaveKey('env', ['APP_ENV' => 'local']);
8181
});
8282

@@ -86,7 +86,7 @@
8686
$config = $codex->mcpServerConfig('php', [], []);
8787

8888
expect($config)->toHaveKey('command', 'php')
89-
->toHaveKey('cwd')
89+
->not->toHaveKey('cwd')
9090
->not->toHaveKey('args')
9191
->not->toHaveKey('env');
9292
});
@@ -170,5 +170,5 @@
170170
->and($capturedContent)->toContain('[mcp_servers.laravel_boost]')
171171
->and($capturedContent)->toContain('command = "php"')
172172
->and($capturedContent)->toContain('args = ["artisan", "boost:mcp"]')
173-
->and($capturedContent)->toContain('cwd = ');
173+
->and($capturedContent)->not->toContain('cwd = ');
174174
});

0 commit comments

Comments
 (0)