LLM frequently exceeds question tool label character limit #7375

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

Originally created by @rmk40 on GitHub (Jan 23, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

The question tool has a 30-character limit on option labels, but this constraint is not clearly communicated in the tool description. This causes LLMs to frequently exceed the limit on their first attempt, requiring a retry after seeing the validation error.

Current behavior

  • Schema has label: z.string().max(30)
  • Tool description says "add '(Recommended)' at the end of the label" for recommended options
  • LLMs create labels like "Use existing patterns (Recommended)" (36 chars) → validation error

Example error:

Error: The question tool was called with invalid arguments: [
  {
    "code": "too_big",
    "maximum": 30,
    "path": ["questions", 0, "options", 0, "label"],
    "message": "Too big: expected string to have <=30 characters"
  }
]

Expected behavior

  • Tool description should explicitly state the 30-character limit for labels and headers
  • Recommendation indicator should be shorter to fit within limits (e.g., * instead of (Recommended))

Proposed fix

Update packages/opencode/src/tool/question.txt to:

  1. Add explicit character limits for labels (30 chars) and headers (30 chars)
  2. Change recommendation suffix from "(Recommended)" (13 chars) to " *" (2 chars)
Originally created by @rmk40 on GitHub (Jan 23, 2026). Originally assigned to: @rekram1-node on GitHub. ## Description The question tool has a 30-character limit on option labels, but this constraint is not clearly communicated in the tool description. This causes LLMs to frequently exceed the limit on their first attempt, requiring a retry after seeing the validation error. ## Current behavior - Schema has `label: z.string().max(30)` - Tool description says "add '(Recommended)' at the end of the label" for recommended options - LLMs create labels like "Use existing patterns (Recommended)" (36 chars) → validation error Example error: ``` Error: The question tool was called with invalid arguments: [ { "code": "too_big", "maximum": 30, "path": ["questions", 0, "options", 0, "label"], "message": "Too big: expected string to have <=30 characters" } ] ``` ## Expected behavior - Tool description should explicitly state the 30-character limit for labels and headers - Recommendation indicator should be shorter to fit within limits (e.g., ` *` instead of `(Recommended)`) ## Proposed fix Update `packages/opencode/src/tool/question.txt` to: 1. Add explicit character limits for labels (30 chars) and headers (30 chars) 2. Change recommendation suffix from "(Recommended)" (13 chars) to " *" (2 chars)
Author
Owner

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

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

  • #7616: Question tool throws if header length is >= 12 chars - related to character limit constraints on question tool headers
  • #10012: Question tool error, ' stops/hangs execution completely in headless mode - reports the exact same validation error for exceeding the 30-character label limit

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

@github-actions[bot] commented on GitHub (Jan 23, 2026): This issue might be a duplicate of existing issues. Please check: - #7616: Question tool throws if header length is >= 12 chars - related to character limit constraints on question tool headers - #10012: Question tool error, ' stops/hangs execution completely in headless mode - reports the exact same validation error for exceeding the 30-character label limit Feel free to ignore if none of these address your specific case.
Author
Owner

@Arasple commented on GitHub (Jan 24, 2026):

Image

same here, been running into this frequently

@Arasple commented on GitHub (Jan 24, 2026): <img width="596" height="424" alt="Image" src="https://github.com/user-attachments/assets/cc19c4f1-650d-4b7a-8f99-dea7e9574ea4" /> same here, been running into this frequently
Author
Owner

@rmk40 commented on GitHub (Jan 25, 2026):

PR resolves this and is a simple change, just needs to be approved.

@rmk40 commented on GitHub (Jan 25, 2026): PR resolves this and is a simple change, just needs to be approved.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7375