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

Open
opened 2026-02-16 17:44:48 -05:00 by yindo · 7 comments
Owner

Originally created by @kandros on GitHub (Jan 10, 2026).

Originally assigned to: @rekram1-node on GitHub.

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

Originally created by @kandros on GitHub (Jan 10, 2026). Originally assigned to: @rekram1-node on GitHub. ### 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 <img width="692" height="283" alt="Image" src="https://github.com/user-attachments/assets/15849a87-853c-4e7d-93ea-b425d8590629" /> ### Operating System macos ### Terminal iterm2
yindo added the bug label 2026-02-16 17:44:48 -05:00
Author
Owner

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

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

  • #7484: Question tool fails to parse JSON with French accented characters (UTF-8) - related to character/parameter validation
  • #7572: Improve UX of question tool multi-select - related to question tool improvements
  • #7496: Question Tool Keyboard Conflict and Agent Switch Issue - related to question tool bugs
  • #7599: Question tool content missing in Web UI - another question tool bug

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

@github-actions[bot] commented on GitHub (Jan 10, 2026): This issue might be a duplicate of existing issues. Please check: - #7484: Question tool fails to parse JSON with French accented characters (UTF-8) - related to character/parameter validation - #7572: Improve UX of question tool multi-select - related to question tool improvements - #7496: Question Tool Keyboard Conflict and Agent Switch Issue - related to question tool bugs - #7599: Question tool content missing in Web UI - another question tool bug Feel free to ignore if none of these address your specific case.
Author
Owner

@Makishima commented on GitHub (Jan 10, 2026):

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

@Makishima commented on GitHub (Jan 10, 2026): The same thing happens to me. OC tries a few other options.
Author
Owner

@ookadoo commented on GitHub (Jan 11, 2026):

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

@ookadoo commented on GitHub (Jan 11, 2026): This happens on Windows 11 (npm) when planning with free models as well, opencode version 1.1.13.
Author
Owner

@Makishima commented on GitHub (Jan 13, 2026):

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

@Makishima commented on GitHub (Jan 13, 2026): By the way, what exactly is this header, and is it only allowed to be 12 characters long?
Author
Owner

@chindris-mihai-alexandru commented on GitHub (Jan 20, 2026):

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
@chindris-mihai-alexandru commented on GitHub (Jan 20, 2026): 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 ```
Author
Owner

@kandros commented on GitHub (Jan 21, 2026):

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

@kandros commented on GitHub (Jan 21, 2026): > 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
Author
Owner

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

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
@Skeptomenos commented on GitHub (Jan 22, 2026): 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
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4616