feat(subagents): add disallowedTools field to agent definitions (#3064)

* feat(subagents): add disallowedTools field to agent definitions

Add a `disallowedTools` blocklist to agent frontmatter, letting agents
specify tools they should not have access to. Supports exact tool names,
MCP server-level patterns (e.g., `mcp__slack`), and display name aliases.

Applied as a post-filter in AgentCore.prepareTools() after the existing
`tools` allowlist. Persisted through serialize/parse roundtrips.

* docs: document disallowedTools and MCP tool behavior for subagents

Add Tool Configuration section to sub-agents docs explaining:
- tools allowlist and disallowedTools blocklist
- How MCP tools follow the same allowlist/blocklist rules
- MCP server-level patterns in disallowedTools

* fix(subagents): validate disallowedTools in SubagentValidator

Reuse the existing validateTools() method to validate disallowedTools
entries at config validation time, catching non-string and empty entries
before they reach runtime.

* test: remove flaky BaseSelectionList scroll test on Windows
This commit is contained in:
tanzhenxin 2026-04-13 18:24:02 +08:00 committed by GitHub
parent 35420b03bc
commit 8d74a0cf0a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 285 additions and 48 deletions

View file

@ -9,8 +9,16 @@
import { describe, it, expect, beforeEach, vi, afterEach } from 'vitest';
import { renderHook, waitFor, act } from '@testing-library/react';
import { useAtCompletion } from './useAtCompletion.js';
import type { Config, FileSearch , FileSystemStructure } from '@qwen-code/qwen-code-core';
import { FileSearchFactory , createTmpDir, cleanupTmpDir } from '@qwen-code/qwen-code-core';
import type {
Config,
FileSearch,
FileSystemStructure,
} from '@qwen-code/qwen-code-core';
import {
FileSearchFactory,
createTmpDir,
cleanupTmpDir,
} from '@qwen-code/qwen-code-core';
import { useState } from 'react';
import type { Suggestion } from '../components/SuggestionsDisplay.js';