Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions inc/Tools/WorkspaceTools.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ public function check_configuration( $configured, $tool_id )
*/
public function __construct()
{
$contexts = array( 'chat', 'pipeline', 'sandbox' );
$policy_contexts = array( 'chat', 'pipeline', 'sandbox' );
$contexts = array( 'chat', 'pipeline' );
$policy_contexts = array( 'chat', 'pipeline' );
$policy_meta = array( 'requires_opt_in' => true );
$this->registerTool('workspace_path', array( $this, 'getPathDefinition' ), $contexts, array( 'ability' => 'datamachine/workspace-path' ));
$this->registerTool('workspace_capabilities', array( $this, 'getCapabilitiesDefinition' ), $contexts, array( 'ability' => 'datamachine/workspace-capabilities' ));
Expand Down
5 changes: 1 addition & 4 deletions inc/Workspace/RemoteWorkspaceBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ class RemoteWorkspaceBackend {
* Whether the remote backend should handle workspace operations.
*/
public static function should_handle(): bool {
$should_handle = ! \DataMachineCode\Support\GitRunner::is_available();
return function_exists('apply_filters')
? (bool) apply_filters('datamachine_code_remote_workspace_backend_should_handle', $should_handle)
: $should_handle;
return ! \DataMachineCode\Support\GitRunner::is_available();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/smoke-workspace-policy-tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static function ( array $tools ) use ( $tool_id, $definition_callback, $contexts
);

foreach ( $default_pipeline_tools as $tool ) {
$assert("{$tool} remains default pipeline-visible and sandbox-visible", array( 'chat', 'pipeline', 'sandbox' ) === ( $tools[ $tool ]['modes'] ?? null ));
$assert("{$tool} remains default pipeline-visible", array( 'chat', 'pipeline' ) === ( $tools[ $tool ]['modes'] ?? null ));
}

$show_definition = $workspace_tools->getShowDefinition();
Expand Down Expand Up @@ -123,7 +123,7 @@ static function ( array $tools ) use ( $tool_id, $definition_callback, $contexts
);

foreach ( $policy_tools as $tool ) {
$assert("{$tool} is available in real chat, pipeline, and sandbox modes", array( 'chat', 'pipeline', 'sandbox' ) === ( $tools[ $tool ]['modes'] ?? null ));
$assert("{$tool} is available in real chat and pipeline modes", array( 'chat', 'pipeline' ) === ( $tools[ $tool ]['modes'] ?? null ));
$assert("{$tool} requires explicit opt-in for pipeline use", true === ( $tools[ $tool ]['requires_opt_in'] ?? null ));
}

Expand Down
Loading