Skip to content

File read tool fails on files containing curly braces {} when using Gemini model #7303

Closed

Description

@sedubois

Description

OpenCode fails to read a file containing {}

Plugins

/

OpenCode version

OpenCode TUI 1.1.6

Steps to reproduce

  • echo "This is a test file with empty curly brackets: {} > test.html.erb`
  • opencode
  • use this prompt: Read the file test.html.erb using your Read tool and show its contents here. If you don't succeed, then report that you didn't succeed. That's all. No other tool than the Read tool. No diagnostics.
  • It will fail and report "I didn't succeed."
  • Remove the curly brackets from the file, run the prompt again, and it will print the contents correctly.

Screenshot and/or share link

https://opncd.ai/share/R6SEz9NU

Operating System

macOS Tahoe

Terminal

Ghostty

Activity

  1. changed the title [-]File read tool does not work with files containing empty curly brackets {}[/-] [+]File read tool does not work with files containing curly braces {}[/+] on Jan 14, 2026
  2. sedubois commented on Jan 14, 2026

    @sedubois
    Author

    Issue persists with OpenCode 1.1.19.

    It looks like the issue occurs whenever a code line contains both an opening { and a closing } curly brace, e.g.:

    <%= link_to ..., data: { turbo_stream: true } %>
    
  3. rekram1-node commented on Jan 14, 2026

    @rekram1-node
    Contributor
    Image

    Cannot replicate

  4. sedubois commented on Jan 15, 2026

    @sedubois
    Author

    Thanks @rekram1-node! I checked different models and here is what I found on my machine:

    Provider Model Read result Error details
    OpenRouter Gemini 3 Flash Preview ❌ -
    OpenRouter Gemini 3 Pro Preview ❌ 400 error "corrupted thought signature"
    OpenRouter Claude Sonnet 4.5 ✅ -
    OpenCode Zen Big Pickle ✅ -

    This seems to suggest an issue with OpenCode-Gemini compatibility? @rekram1-node could you try reproducing on your side with Gemini 3 Flash preview?

    Details/screenshots below.

    Details

    As shown in the OP, if I switch the model to Gemini 3 flash preview using OpenRouter provider, start a new session, and submit the prompt, it fails:

    Image

    If I switch the model to Gemini 3 pro preview using OpenRouter provider, start a new session, and submit the prompt, it fails with a 400 error "corrupted thought signature":

    Image

    If I switch the model to Claude Sonnet 4.5 using OpenRouter provider, start a new session, and submit the prompt, it succeeds:

    Image

    If I switch the model to big-pickle (OpenCode Zen provider), start a new session, and submit the prompt, it succeeds:

    Image
  5. changed the title [-]File read tool does not work with files containing curly braces {}[/-] [+]File read tool fails on files containing curly braces {} when using Gemini model[/+] on Jan 15, 2026
  6. github-actions commented on Mar 26, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions