Skip to content

Question tool throws if header length is >= 12 chars #7616

Closed

Description

@kandros

Description

Happened after I submitted a custom response

Plugins

none

OpenCode version

1.1.11

Steps to reproduce

No response

Screenshot and/or share link

Image

Operating System

macos

Terminal

iterm2

Activity

  1. github-actions commented on Jan 10, 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. Makishima commented on Jan 10, 2026

    @Makishima

    The same thing happens to me. OC tries a few other options.

  3. ookadoo commented on Jan 11, 2026

    @ookadoo

    This happens on Windows 11 (npm) when planning with free models as well, opencode version 1.1.13.

  4. Makishima commented on Jan 13, 2026

    @Makishima

    By the way, what exactly is this header, and is it only allowed to be 12 characters long?

  5. chindris-mihai-alexandru commented on Jan 20, 2026

    @chindris-mihai-alexandru

    Ran into a similar issue but with the label field (30 char limit) instead of header (12 chars). The error message doesn't say which field failed or what the limit is, so the model just keeps retrying with similar invalid input.

    Would be great if validation errors included the field name and actual constraint, like:

    options[0].label: "Enable advanced mode (Recommended)" (35 chars) exceeds max of 30
    
  6. kandros commented on Jan 21, 2026

    @kandros
    ContributorAuthor

    By the way, what exactly is this header, and is it only allowed to be 12 characters long?

    I guess it's the question itself that gets AI-generated

  7. Skeptomenos commented on Jan 22, 2026

    @Skeptomenos

    Still reproducing on v1.1.32 with Claude (Anthropic).

    Screenshot

    The error shows the label field exceeding 30 characters:

    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"
      }
    ]
    

    Observations

    • The model's system prompt does include the constraint ("maxLength": 30 for label), but it frequently ignores it
    • When the error occurs, the model often retries with similar invalid input because the error message doesn't show the actual offending value
    • This breaks the flow and requires user intervention

    Suggested fixes (in order of preference)

    1. Auto-truncate labels/headers with ellipsis if they exceed limits (least disruptive)
    2. Increase limits - 30 chars for a label is quite restrictive (e.g., "Enable advanced mode (Recommended)" is a common pattern that exceeds it)
    3. Better error messages showing the actual value that failed, so the model can self-correct
  8. github-actions commented on Mar 26, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 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

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions