fix: isolate visual tool failures from agent runs
This commit is contained in:
@@ -17,6 +17,7 @@ import {
|
||||
resolveSandboxMcpControlDbEnv,
|
||||
sandboxDeveloperTools,
|
||||
sandboxMcpTools,
|
||||
withoutSessionImageRead,
|
||||
} from './capabilities.mjs';
|
||||
import {
|
||||
verifyMindSpaceMcpScopedToken,
|
||||
@@ -575,6 +576,33 @@ test('sandboxMcp emits a scoped logical workspace token only for a bound session
|
||||
);
|
||||
});
|
||||
|
||||
test('withoutSessionImageRead removes only the optional visual inspection tool', () => {
|
||||
const policy = {
|
||||
gooseMode: 'chat',
|
||||
extensionOverrides: [
|
||||
{ name: 'memory', available_tools: [] },
|
||||
{ name: 'developer', available_tools: ['write', 'read_image'] },
|
||||
],
|
||||
};
|
||||
|
||||
const next = withoutSessionImageRead(policy);
|
||||
|
||||
assert.deepEqual(next.extensionOverrides, [
|
||||
{ name: 'memory', available_tools: [] },
|
||||
{ name: 'developer', available_tools: ['write'] },
|
||||
]);
|
||||
assert.deepEqual(policy.extensionOverrides[1].available_tools, ['write', 'read_image']);
|
||||
assert.deepEqual(
|
||||
withoutSessionImageRead({
|
||||
extensionOverrides: [
|
||||
{ name: 'memory', available_tools: [] },
|
||||
{ name: 'developer', available_tools: ['read_image'] },
|
||||
],
|
||||
}).extensionOverrides,
|
||||
[{ name: 'memory', available_tools: [] }],
|
||||
);
|
||||
});
|
||||
|
||||
test('sandboxMcp honors container node executable override', () => {
|
||||
const caps = { ...DEFAULT_USER_CAPABILITIES, static_publish: true };
|
||||
const policy = buildAgentExtensionPolicy(caps, {
|
||||
|
||||
Reference in New Issue
Block a user