fix(engine): register grep/find/ls alongside read/bash/edit/write for coding sessions

pi-coding-agent 0.70's createCodingTools preset only includes read/bash/edit/write,
but pi-claude-cli's tool-mapping translates Claude's Glob→find and Grep→grep.
Triage sessions running through Claude CLI hit "Tool find not found" the moment
the model called Glob and looped on the error.

Compose the built-in set explicitly so every tool referenced by tool-mapping.ts
is registered. Read-only sessions also gain ls (was silently dropped earlier
when readonly was redefined upstream).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-04-25 16:34:31 -07:00
parent 359e08c45c
commit 73ff095ccc
3 changed files with 66 additions and 2 deletions

View File

@@ -35,6 +35,13 @@ vi.mock("@mariozechner/pi-coding-agent", () => ({
})),
createCodingTools: vi.fn(() => []),
createReadOnlyTools: vi.fn(() => []),
createReadTool: vi.fn(() => ({ name: "read" })),
createBashTool: vi.fn(() => ({ name: "bash" })),
createEditTool: vi.fn(() => ({ name: "edit" })),
createWriteTool: vi.fn(() => ({ name: "write" })),
createGrepTool: vi.fn(() => ({ name: "grep" })),
createFindTool: vi.fn(() => ({ name: "find" })),
createLsTool: vi.fn(() => ({ name: "ls" })),
createExtensionRuntime: vi.fn(),
DefaultResourceLoader: vi.fn().mockImplementation(() => ({
reload: vi.fn().mockResolvedValue(undefined),