Skip to content

Commit ef3836e

Browse files
authored
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>
1 parent 70b7d36 commit ef3836e

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ export function mapToolAccessToOAC(
264264
* Check if a tool name is a valid OAC tool.
265265
*/
266266
function isValidOACTool(name: string): name is keyof ToolAccess {
267-
const validTools = ["read", "write", "edit", "bash", "task", "grep", "glob", "patch"];
267+
const validTools = ["read", "write", "edit", "bash", "task", "grep", "glob", "patch", "question"];
268268
return validTools.includes(name);
269269
}
270270

packages/compatibility-layer/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const ToolAccessSchema = z.object({
1717
grep: z.boolean().optional(),
1818
glob: z.boolean().optional(),
1919
patch: z.boolean().optional(),
20+
question: z.boolean().optional(),
2021
});
2122

2223
// ============================================================================

0 commit comments

Comments
 (0)