Skip to content

Commit 75a4cc8

Browse files
committed
feat: default process isolation to true
1 parent 8f16414 commit 75a4cc8

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

src/Mcp/ToolExecutor.php

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,8 @@ class ToolExecutor
1313
{
1414
public function __construct()
1515
{
16-
//
1716
}
1817

19-
/**
20-
* Execute a tool with the given arguments.
21-
*
22-
* @param array<string, mixed> $arguments
23-
*/
2418
public function execute(string $toolClass, array $arguments = []): ToolResult
2519
{
2620
if (! ToolRegistry::isToolAllowed($toolClass)) {
@@ -34,11 +28,6 @@ public function execute(string $toolClass, array $arguments = []): ToolResult
3428
return $this->executeInline($toolClass, $arguments);
3529
}
3630

37-
/**
38-
* Execute tool in a separate process for isolation.
39-
*
40-
* @param array<string, mixed> $arguments
41-
*/
4231
protected function executeInProcess(string $toolClass, array $arguments): ToolResult
4332
{
4433
$command = [
@@ -77,14 +66,10 @@ protected function executeInProcess(string $toolClass, array $arguments): ToolRe
7766
}
7867
}
7968

80-
/**
81-
* Execute tool inline (current process).
82-
*
83-
* @param array<string, mixed> $arguments
84-
*/
8569
protected function executeInline(string $toolClass, array $arguments): ToolResult
8670
{
8771
try {
72+
/** @var \Laravel\Mcp\Server\Tool $tool */
8873
$tool = app($toolClass);
8974

9075
return $tool->handle($arguments);
@@ -93,22 +78,15 @@ protected function executeInline(string $toolClass, array $arguments): ToolResul
9378
}
9479
}
9580

96-
/**
97-
* Check if process isolation should be used.
98-
*/
9981
protected function shouldUseProcessIsolation(): bool
10082
{
101-
// Never use process isolation in testing environment
10283
if (app()->environment('testing')) {
10384
return false;
10485
}
10586

106-
return config('boost.process_isolation.enabled', false);
87+
return config('boost.process_isolation.enabled', true);
10788
}
10889

109-
/**
110-
* Get the execution timeout.
111-
*/
11290
protected function getTimeout(): int
11391
{
11492
return config('boost.process_isolation.timeout', 180);

0 commit comments

Comments
 (0)