Skip to content

[BUG] Gemini not outputting [0] #8914

@sergedc

Description

@sergedc

Problem (one or two sentences)

If gemini creates code with [0], the [0] disappear when the code ends up in the file.

Context (who is affected and when)

How to replicate:
System: Windows, VS code, Roo code extension (any version for the past 2 weeks),
API provider: Google Gemini
Model: gemini-2.5-pro

Reproduction steps

Prompt:
Create a python file that creates a list of 10 fruits (you choose them) then put the first one in the variable "myfruit"

Result:
fruits = ["Apple", "Banana", "Orange", "Grape", "Strawberry", "Blueberry", "Watermelon", "Pineapple", "Mango", "Peach"]
myfruit = fruits

print(f"The list of fruits is: {fruits}")
print(f"My favorite fruit is: {myfruit}")

Notice the [0] is missing.

This is happening to me 100% of the time for at least 2 weeks (but maybe more).

Expected result

myfruit = fruits[0]

Actual result

myfruit = fruits

Variations tried (optional)

No response

App Version

3.29.3

API Provider (optional)

Google Gemini

Model Used (optional)

Gemini 2.5 pro

Roo Code Task Links (optional)

No response

Relevant logs or errors (optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue/PR - TriageNew issue. Needs quick review to confirm validity and assign labels.bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions