Skip to content

[BUG] Bug with array square brackets with Gemini (various models) - Related/same issue to 7576 #8107

@64MM4-KN1F3

Description

@64MM4-KN1F3

Problem (one or two sentences)

Hey roo folks, was the following fix targetted only for C#?

@mrubens @hannesrudolph, I should have mentioned in my prev reply in 7576 that I'm seeing this issue with python too (and I'm guessing the problem could be non-language specific as a result)

I just built a255c95 and using gemini 2.5 via GCP API (pro + flash) a similar (or the same) issue remains:

Example of issue 📛

Create the following file 'roo_test.py'

import os

script_path = os.path.abspath(os.path.dirname(__file__))
populated_variable = script_path

print(f"The script is run from: {populated_variable}")

I asked the following in Code mode using various gemini models via the GCP API :
Please update the script @/roo_test.py to print a second output showing only the first character of the populated_variable string

File modification:

<<<<<<< SEARCH
:start_line:6
-------
print(f"The script is run from: {populated_variable}")
=======
print(f"The script is run from: {populated_variable}")
print(f"The first character is: {populated_variable}")
>>>>>>> REPLACE

Image

Context (who is affected and when)

When user requests code modification involving square brackets

Reproduction steps

Create the following file 'roo_test.py'

import os

script_path = os.path.abspath(os.path.dirname(__file__))
populated_variable = script_path

print(f"The script is run from: {populated_variable}")

I asked the following in Code mode using various gemini models via the GCP API :
Please update the script @/roo_test.py to print a second output showing only the first character of the populated_variable string

File modification:

<<<<<<< SEARCH
:start_line:6
-------
print(f"The script is run from: {populated_variable}")
=======
print(f"The script is run from: {populated_variable}")
print(f"The first character is: {populated_variable}")
>>>>>>> REPLACE

Image

Expected result

Second print should be: print(f"The first character is: {populated_variable[0]}")

Actual result

print(f"The first character is: {populated_variable}")

Variations tried (optional)

No response

App Version

Version: 3.28.3+ (Built from a255c95)

API Provider (optional)

Google Gemini

Model Used (optional)

Gemini 2.5 pro + flash via GCP API

Roo Code Task Links (optional)

No response

Relevant logs or errors (optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue - Unassigned / ActionableClear and approved. Available for contributors to pick up.bugSomething isn't working

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions