fix(hub): include Edit in default single-agent tools

Merge pull request #34 from fix/hub-include-edit-tool
This commit is contained in:
2026-07-25 14:19:04 +08:00
2 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -1,6 +1,7 @@
export const DEFAULT_CLAUDE_BUILT_IN_TOOLS = [
"Read",
"Write",
"Edit",
"Bash",
"Glob",
"Grep",
@@ -31,7 +32,7 @@ export interface ClaudeSdkToolConfig {
const ROLE_TOOL_TO_CLAUDE_BUILT_INS: Readonly<Record<string, readonly string[]>> = {
read_file: ["Read"],
write_file: ["Write"],
write_file: ["Write", "Edit"],
list_files: ["Glob"],
search_files: ["Grep"],
bash: ["Bash"],
@@ -46,6 +47,7 @@ const ROLE_TOOL_TO_CLAUDE_BUILT_INS: Readonly<Record<string, readonly string[]>>
TodoWrite: ["TodoWrite"],
Read: ["Read"],
Write: ["Write"],
Edit: ["Edit"],
Bash: ["Bash"],
Glob: ["Glob"],
Grep: ["Grep"],
+2 -1
View File
@@ -114,7 +114,7 @@ describe("runAgent", () => {
allowDangerouslySkipPermissions: true,
settingSources: [],
settings: { disableBundledSkills: true, todoFeatureEnabled: true },
tools: expect.arrayContaining(["Read", "Write", "Bash", "Glob", "Grep", "TodoWrite"]),
tools: expect.arrayContaining(["Read", "Write", "Edit", "Bash", "Glob", "Grep", "TodoWrite"]),
allowedTools: expect.arrayContaining(["TodoWrite", "mcp__cph_hub__todo_write"]),
disallowedTools: expect.arrayContaining(["Agent", "SendMessage", "Task", "TeamCreate", "ScheduleWakeup"]),
sandbox: expect.objectContaining({
@@ -151,6 +151,7 @@ describe("runAgent", () => {
expect(call?.options?.tools).toEqual([
"Read",
"Write",
"Edit",
"Bash",
"Glob",
"Grep",