fix: add missing 'question' tool to ToolAccessSchema (#269)

The 'question' tool is a built-in OpenCode tool used to ask users
to make decisions, but it was missing from the ToolAccessSchema in
types.ts and the isValidOACTool() function in ToolMapper.ts.

This prevented OpenCoder/OpenAgent agents from accessing the tool
even when explicitly configured.

Changes:
- Add question: z.boolean().optional() to ToolAccessSchema
- Add 'question' to validTools array in isValidOACTool()

Fixes #268

Co-authored-by: BillionClaw <267901332+BillionClaw@users.noreply.github.com>
This commit is contained in:
BillionToken 2026-03-25 06:16:19 +08:00 committed by GitHub
parent 70b7d362dc
commit ef3836efd6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -264,7 +264,7 @@ export function mapToolAccessToOAC(
* Check if a tool name is a valid OAC tool. * Check if a tool name is a valid OAC tool.
*/ */
function isValidOACTool(name: string): name is keyof ToolAccess { function isValidOACTool(name: string): name is keyof ToolAccess {
const validTools = ["read", "write", "edit", "bash", "task", "grep", "glob", "patch"]; const validTools = ["read", "write", "edit", "bash", "task", "grep", "glob", "patch", "question"];
return validTools.includes(name); return validTools.includes(name);
} }

View file

@ -17,6 +17,7 @@ export const ToolAccessSchema = z.object({
grep: z.boolean().optional(), grep: z.boolean().optional(),
glob: z.boolean().optional(), glob: z.boolean().optional(),
patch: z.boolean().optional(), patch: z.boolean().optional(),
question: z.boolean().optional(),
}); });
// ============================================================================ // ============================================================================