Skip to content

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

Closed as not planned

Description

@rwese

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

Activity

  1. github-actions commented on Jan 22, 2026

    @github-actions
    Contributor

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

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

  2. rwese commented on Jan 22, 2026

    @rwese
    ContributorAuthor

    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
  3. rwese commented on Jan 22, 2026

    @rwese
    ContributorAuthor

    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. :(

  4. rwese commented on Jan 22, 2026

    @rwese
    ContributorAuthor

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

    {
      "$schema": "https://opencode.ai/config.json",
      "permission": {
        "question": "deny"
      }
    }
  5. rwese commented on Jan 23, 2026

    @rwese
    ContributorAuthor

    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.

  6. yajo commented on Mar 12, 2026

    @yajo

    Isn't this fixed in #11379?

  7. removed
    bugSomething isn't working
    on May 3, 2026
  8. dnut commented on May 20, 2026

    @dnut

    No this is not fixed. The question tool is opt-in for acp mode, but not for cli mode. See #13562. The question tool should simply needs to be disabled in cli mode since it's not usable at all.

  9. github-actions commented on Jul 20, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions