Skip to content

Quotes in code getting stripped in model output #5591

@jdanbrown

Description

@jdanbrown

Description

This one is bizzare: I asked openrouter/anthropic/claude-sonnet-4.5 to generate some vscode keybindings.json stuff for me, and the json in its response had no quotes. I asked it to fix it, and it gave me json with no quotes again. Then I used mitmproxy to snoop on the wire traffic, and the model responses actually include the quotes, but opencode is somehow failing to show them in its code blocks in the model output.

Here's mitmproxy on the left showing the model response with quotes, and opencode on the right showing the model response without quotes:

  • mitmproxy on the left: ...\"key\": \"ctrl+m\"...
  • opencode on the right: key: ctrl+m
Image

OpenCode version

1.0.159

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

macOS 15.5

Terminal

VS Code terminal

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions