Skip to content

fix: add missing 'question' tool to compatibility layer#269

Open
BillionClaw wants to merge 1 commit intodarrenhinde:mainfrom
BillionClaw:fix/add-question-tool
Open

fix: add missing 'question' tool to compatibility layer#269
BillionClaw wants to merge 1 commit intodarrenhinde:mainfrom
BillionClaw:fix/add-question-tool

Conversation

@BillionClaw
Copy link

Problem

OpenCode's "question" tool is not recognized when using OpenCoder/OpenAgent integration, causing tool calls to fail validation.

Root Cause

The "question" tool was missing from two locations in the compatibility layer:

  1. "ToolMapper.ts": The "isValidOACTool()" function didn't include "question" in the valid tools array
  2. "types.ts": The "ToolAccessSchema" Zod schema didn't define the "question" field

Change

  • Added "question" to the valid tools array in "isValidOACTool()"
  • Added "question: z.boolean().optional()" to "ToolAccessSchema"

Verification

  • "git diff --check": No whitespace errors
  • "npm run build": TypeScript compilation clean
  • "npm run test": 583/584 tests passed (1 pre-existing failure unrelated to this fix)
  • All 34 ToolMapper tests passed

Risk/Edge Cases

  • Minimal risk: The change only adds an optional field that was already expected by OpenCode
  • No breaking changes - existing tools continue to work
  • The "question" tool is now opt-in via the same pattern as other tools

Issue

Fixes #268

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 darrenhinde#268
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] OpenCode's question not working with OpenCoder/OpenAgent

1 participant