Browse Source

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>
BillionToken 2 weeks ago
parent
commit
ef3836efd6

+ 1 - 1
packages/compatibility-layer/src/mappers/ToolMapper.ts

@@ -264,7 +264,7 @@ export function mapToolAccessToOAC(
  * Check if a tool name is a valid OAC tool.
  */
 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);
 }
 

+ 1 - 0
packages/compatibility-layer/src/types.ts

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