Question tool error, ' stops/hangs execution completely in headless mode #7193

Open
opened 2026-02-16 18:06:25 -05:00 by yindo · 5 comments
Owner

Originally created by @rwese on GitHub (Jan 22, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

When I run opencode in a a loop it sometimes causes the Agent to ask questions,

question_tool_error.json

i use opencode run --agent ... , so questions are useless too, causing my loop/script to get stuck.

→ Asked 2 questions
Error: The question tool was called with invalid arguments: [
  {
    "origin": "string",
    "code": "too_big",
    "maximum": 30,
    "inclusive": true,
    "path": [
      "questions",
      0,
      "options",
      0,
      "label"
    ],
    "message": "Too big: expected string to have <=30 characters"
  },
  {
    "origin": "string",
    "code": "too_big",
    "maximum": 30,
    "inclusive": true,
    "path": [
      "questions",
      1,
      "options",
      0,
      "label"
    ],
    "message": "Too big: expected string to have <=30 characters"
  }
].
Please rewrite the input so it satisfies the expected schema
Image

Plugins

No response

OpenCode version

OpenCode 1.1.31

Steps to reproduce

  1. I was unable to force the error, i hope the exported session helps.

attempt, here it worked fine everytime:

we are debugging a opencode issue, it fails to propperly handle/ask very long choice question. 
write a 2 paragraph stories and ask which is better to verify this issue.
ask using the question too.
Image

Screenshot and/or share link

https://opncd.ai/share/uF0512WZ

Operating System

MacOS Tahoe 26

Terminal

Ghostty, but was running in a shellscript loop

Originally created by @rwese on GitHub (Jan 22, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description When I run opencode in a a loop it sometimes causes the Agent to ask questions, [question_tool_error.json](https://github.com/user-attachments/files/24794040/question_tool_error.json) i use `opencode run --agent ... `, so questions are useless too, causing my loop/script to get stuck. ``` → Asked 2 questions Error: The question tool was called with invalid arguments: [ { "origin": "string", "code": "too_big", "maximum": 30, "inclusive": true, "path": [ "questions", 0, "options", 0, "label" ], "message": "Too big: expected string to have <=30 characters" }, { "origin": "string", "code": "too_big", "maximum": 30, "inclusive": true, "path": [ "questions", 1, "options", 0, "label" ], "message": "Too big: expected string to have <=30 characters" } ]. Please rewrite the input so it satisfies the expected schema ``` <img width="832" height="776" alt="Image" src="https://github.com/user-attachments/assets/8ac4a285-79f8-48ec-8edb-b5bf2a3dedb7" /> ### Plugins _No response_ ### OpenCode version OpenCode 1.1.31 ### Steps to reproduce 1. I was unable to force the error, i hope the exported session helps. attempt, here it worked fine everytime: ```md we are debugging a opencode issue, it fails to propperly handle/ask very long choice question. write a 2 paragraph stories and ask which is better to verify this issue. ask using the question too. ``` <img width="883" height="542" alt="Image" src="https://github.com/user-attachments/assets/5039c6ef-3999-4933-b443-7dc1b1b436f2" /> ### Screenshot and/or share link https://opncd.ai/share/uF0512WZ ### Operating System MacOS Tahoe 26 ### Terminal Ghostty, but was running in a shellscript loop
yindo added the bug label 2026-02-16 18:06:25 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 22, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #9830: Question tools block execution in opencode run ... mode - directly related to headless mode blocking
  • #8650: Error: The question tool was called with invalid arguments - similar validation error with question tool (too_big for label vs header)
  • #7616: Question tool throws if header length is >= 12 chars - related to character limit validation in question tool

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 22, 2026): This issue might be a duplicate of existing issues. Please check: - #9830: Question tools block execution in `opencode run ...` mode - directly related to headless mode blocking - #8650: Error: The question tool was called with invalid arguments - similar validation error with question tool (`too_big` for `label` vs `header`) - #7616: Question tool throws if header length is >= 12 chars - related to character limit validation in question tool Feel free to ignore if none of these address your specific case.
Author
Owner

@rwese commented on GitHub (Jan 22, 2026):

Expected behavior would be:

  • question 'tool' error is returned to the model for rewriting the question
  • during non-interactive terminal session, the question tool must not be available
@rwese commented on GitHub (Jan 22, 2026): Expected behavior would be: - question 'tool' error is returned to the model for rewriting the question - during non-interactive terminal session, the question tool must not be available
Author
Owner

@rwese commented on GitHub (Jan 22, 2026):

Let me know if any of the options, or any other, you would like to see, I am happy to implement it, as it breaks my ralph. :(

@rwese commented on GitHub (Jan 22, 2026): Let me know if any of the options, or any other, you would like to see, I am happy to implement it, as it breaks my ralph. :(
Author
Owner

@rwese commented on GitHub (Jan 22, 2026):

Found the workaround, disable the tool, either globally or for a specific agent.

{
  "$schema": "https://opencode.ai/config.json",
  "permission": {
    "question": "deny"
  }
}
@rwese commented on GitHub (Jan 22, 2026): Found the workaround, disable the tool, either globally or for a specific agent. ```json { "$schema": "https://opencode.ai/config.json", "permission": { "question": "deny" } } ```
Author
Owner

@rwese commented on GitHub (Jan 23, 2026):

Happens also when using as ACP, in Zed for example:

Image

I am unaware if this might be a implementation issue in the Client

Session Export:

acp_session.json

        {
          "id": "prt_beb3703de001lJ28nbZsvWaZ3o",
          "sessionID": "ses_414cd0464ffeKV5D33YzVhi6kL",
          "messageID": "msg_beb36fb5c0011c3DnH7gu0ENIp",
          "type": "tool",
          "callID": "call_function_qjwy0qfku09b_1",
          "tool": "question",
          "state": {
            "status": "running",
            "input": {
              "questions": [
                {
                  "header": "Skill check",
                  "multiple": false,
                  "options": [
                    {
                      "description": "A script or hook named skill-check or similar",
                      "label": "Custom script"
                    },
                    {
                      "description": "A lefthook hook that validates skill files",
                      "label": "Lefthook hook"
                    },
                    {
                      "description": "Something else not listed here",
                      "label": "Other"
                    }
                  ],
                  "question": "What specific \"skill check\" are you referring to? I don't see any skill-related pre-commit hooks in the current lefthook.yml configuration. Could you clarify where this check is defined?"
                }
              ]
            },
            "time": {
              "start": 1769177811182
            }
          }
        }

Bonus issue: The weird thing is, the agent did not have the 'question' permission, via cli they never ask.

@rwese commented on GitHub (Jan 23, 2026): Happens also when using as ACP, in Zed for example: <img width="632" height="362" alt="Image" src="https://github.com/user-attachments/assets/e468c562-d5f2-4921-80cc-94a738291f6c" /> _I am unaware if this might be a implementation issue in the Client_ Session Export: [acp_session.json](https://github.com/user-attachments/files/24822864/acp_session.json) ```json { "id": "prt_beb3703de001lJ28nbZsvWaZ3o", "sessionID": "ses_414cd0464ffeKV5D33YzVhi6kL", "messageID": "msg_beb36fb5c0011c3DnH7gu0ENIp", "type": "tool", "callID": "call_function_qjwy0qfku09b_1", "tool": "question", "state": { "status": "running", "input": { "questions": [ { "header": "Skill check", "multiple": false, "options": [ { "description": "A script or hook named skill-check or similar", "label": "Custom script" }, { "description": "A lefthook hook that validates skill files", "label": "Lefthook hook" }, { "description": "Something else not listed here", "label": "Other" } ], "question": "What specific \"skill check\" are you referring to? I don't see any skill-related pre-commit hooks in the current lefthook.yml configuration. Could you clarify where this check is defined?" } ] }, "time": { "start": 1769177811182 } } } ``` **Bonus issue:** The weird thing is, the agent did not have the 'question' permission, via cli they never ask.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7193