feat(tools): surface browser tool activation and policy diagnostics

This commit is contained in:
William Valentin
2026-02-16 18:16:43 -08:00
parent fc6a79ed90
commit 10a83717f9
2 changed files with 46 additions and 0 deletions
+34
View File
@@ -196,6 +196,40 @@ describe('configSchema — server', () => {
});
});
describe('configSchema — browser', () => {
const minimalConfig = {
telegram: { bot_token: 'test', allowed_chat_ids: [1] },
models: { default: { provider: 'anthropic', model: 'claude-3' } },
};
it('defaults browser tools to disabled with safe runtime defaults', () => {
const result = configSchema.parse(minimalConfig);
expect(result.browser.enabled).toBe(false);
expect(result.browser.headless).toBe(true);
expect(result.browser.max_pages).toBe(5);
expect(result.browser.default_timeout).toBe(30000);
});
it('accepts explicit browser config', () => {
const result = configSchema.parse({
...minimalConfig,
browser: {
enabled: true,
executable_path: '/usr/bin/chromium',
headless: false,
max_pages: 3,
default_timeout: 45000,
},
});
expect(result.browser.enabled).toBe(true);
expect(result.browser.executable_path).toBe('/usr/bin/chromium');
expect(result.browser.headless).toBe(false);
expect(result.browser.max_pages).toBe(3);
expect(result.browser.default_timeout).toBe(45000);
});
});
describe('configSchema — backup', () => {
const minimalConfig = {
telegram: { bot_token: 'test', allowed_chat_ids: [1] },