[Bug] Question tool fails to parse JSON with French accented characters (UTF-8) #4526

Open
opened 2026-02-16 17:44:29 -05:00 by yindo · 1 comment
Owner

Originally created by @fdematos on GitHub (Jan 9, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

The question tool (introduced in v1.1.7) fails to parse JSON parameters when the question text or option labels contain French accented characters (é, è, à, ê, ù, etc.).

Expected Behavior

The interactive question dialog should display with the French text properly rendered, allowing the user to select an option.

Actual Behavior

The tool returns a JSON parsing error:

Error: The question tool was called with invalid arguments: [
  {
    "expected": "array",
    "code": "invalid_type",
    "path": ["questions"],
    "message": "Invalid input: expected array, received string"
  }
]

The JSON array with accented characters appears to be incorrectly parsed as a string.

Additional Context

  • The error suggests the JSON payload is being corrupted during transmission or parsing
  • This may be related to UTF-8 encoding of the parameters before validation
  • Similar issues with non-ASCII characters were reported in #6921 (WebUI with non-ASCII directory names)
  • Potentially related to #7392 (another question tool bug)

Plugins

No response

OpenCode version

1.1.8

Steps to reproduce

Steps to Reproduce

  1. Have the agent call the question tool with French text containing accents:
{
  "questions": [{
    "question": "Que souhaitez-vous que je prépare pour cette non-conformité ?",
    "header": "Action",
    "options": [
      {"label": "Réponse CAPA uniquement", "description": "Juste le texte CAPA à insérer"},
      {"label": "Créer dossier 6.1.2/", "description": "Créer un dossier avec documentation"}
    ],
    "multiple": false
  }]
}

Screenshot and/or share link

No response

Operating System

macOS (darwin)

Terminal

Standard macOS terminal

Originally created by @fdematos on GitHub (Jan 9, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description The `question` tool (introduced in v1.1.7) fails to parse JSON parameters when the question text or option labels contain French accented characters (é, è, à, ê, ù, etc.). ## Expected Behavior The interactive question dialog should display with the French text properly rendered, allowing the user to select an option. ## Actual Behavior The tool returns a JSON parsing error: ``` Error: The question tool was called with invalid arguments: [ { "expected": "array", "code": "invalid_type", "path": ["questions"], "message": "Invalid input: expected array, received string" } ] ``` The JSON array with accented characters appears to be incorrectly parsed as a string. ## Additional Context - The error suggests the JSON payload is being corrupted during transmission or parsing - This may be related to UTF-8 encoding of the parameters before validation - Similar issues with non-ASCII characters were reported in #6921 (WebUI with non-ASCII directory names) - Potentially related to #7392 (another question tool bug) ### Plugins _No response_ ### OpenCode version 1.1.8 ### Steps to reproduce ## Steps to Reproduce 1. Have the agent call the `question` tool with French text containing accents: ```json { "questions": [{ "question": "Que souhaitez-vous que je prépare pour cette non-conformité ?", "header": "Action", "options": [ {"label": "Réponse CAPA uniquement", "description": "Juste le texte CAPA à insérer"}, {"label": "Créer dossier 6.1.2/", "description": "Créer un dossier avec documentation"} ], "multiple": false }] } ``` ### Screenshot and/or share link _No response_ ### Operating System macOS (darwin) ### Terminal Standard macOS terminal
yindo added the bug label 2026-02-16 17:44:29 -05:00
Author
Owner

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

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

  • #7464: question tool not rendering interactive UI in OpenCode Web - only displays plain text
  • #7392: opentui: fatal: answer.join is not a function (related to question tool output handling)

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

@github-actions[bot] commented on GitHub (Jan 9, 2026): This issue might be a duplicate of existing issues. Please check: - #7464: `question` tool not rendering interactive UI in OpenCode Web - only displays plain text - #7392: opentui: fatal: answer.join is not a function (related to question tool output handling) Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4526