Skip to content

LLM frequently exceeds question tool label character limit #10283

Closed

Description

@rmk40

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)

Activity

  1. github-actions commented on Jan 23, 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. added a commit that references this issue on Jan 23, 2026
    ed11735
  3. Arasple commented on Jan 24, 2026

    @Arasple
    Contributor
    Image

    same here, been running into this frequently

  4. rmk40 commented on Jan 26, 2026

    @rmk40
    ContributorAuthor

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

  5. git-malu commented on Mar 8, 2026

    @git-malu

    currently situation: can't display the full text of the options
    Image

  6. tredondo commented on Mar 11, 2026

    @tredondo

    This issue is still present in v1.2.24, and important, as it severely cripples the LLM output for complex answers. Please prioritize.

    Image
  7. aklajnert commented on Mar 12, 2026

    @aklajnert

    The proposed solution is wrong in my opinion. The TUI client is able to show a whole output of the command. Instead of limiting the model's response, just modify the GUI to either not truncate the text or allow to remove truncation on demand.

    There is a workaround - if you open the context and expand the latest message, you can see the raw question with a whole content.

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