cline icon indicating copy to clipboard operation
cline copied to clipboard

Gemini 2.5 - <environment_details> showing up in code

Open pmsteil opened this issue 9 months ago • 5 comments

What happened?

Keep getting this at the end of a code file:

</final_file_content>

IMPORTANT: For any future changes to this file, use the final_file_content shown above as your reference. This content reflects the current state of the file, including any auto-formatting (e.g., if you used single quotes but the formatter converted them to double quotes). Always base your SEARCH/REPLACE operations on this final version to ensure accuracy.

<environment_details>
# VSCode Visible Files
generate_zeus_to_nucc_mappings.py

# VSCode Open Tabs
llm_client.py
generate_nucc_to_zeus_mappings.py
__architecture__/project_status.md
generate_zeus_to_nucc_mappings.py
.env.sample
.env

# Current Time
3/28/2025, 12:29:00 PM (America/Chicago, UTC-5:00)

# Current Mode
ACT MODE
</environment_details>

and cline says:

Okay, it seems the file modification tools are consistently causing issues. I apologize for the repeated failures and syntax errors introduced.

Let's try the most robust approach:

I will use the content from the last successful read_file result (which contains the debug code and longer sleep times).
I will manually edit this content to remove the debug print statements and revert the time.sleep delays back to 0.5 seconds within the handle_manual_mapping function.
I will use write_to_file with this carefully corrected full content.

But it keeps happening unless I manually remove that bad code...

Steps to reproduce

  1. Just doing normal code changes to a 1455 line python code file...

Relevant API REQUEST output

Okay, it seems the file modification tools are consistently causing issues. I apologize for the repeated failures and syntax errors introduced.

Let's try the most robust approach:

I will use the content from the last successful read_file result (which contains the debug code and longer sleep times).
I will manually edit this content to remove the debug print statements and revert the time.sleep delays back to 0.5 seconds within the handle_manual_mapping function.
I will use write_to_file with this carefully corrected full content.

Operating System

MacOS

Cline Version

3.8.4

Additional context

No response

pmsteil avatar Mar 28 '25 17:03 pmsteil

Hello,

Could you provide more information? What provider/model is this occurring on?

frostbournesb avatar Mar 28 '25 22:03 frostbournesb

Hi @frostbournesb ,

I also face this problem by using gemini-2.5-pro-exp-03-25 model.

It will generate tag like @pmsteil said below of files that it take edit actions in sometimes.

And it cannot always success in fixing it by itself. So I have to stop it and remove those tag for it.

Arsapol avatar Mar 29 '25 05:03 Arsapol

same </final_file_content> at end of file

gitoutoftown avatar Apr 01 '25 23:04 gitoutoftown

Happens quite a bit here as well

wojo avatar Apr 05 '25 01:04 wojo

Happens to me quite often - I'll get the whole <environment_details> block with gemini-2.5-pro-preview-05-06. Seems to start happening more often later into a long task.

dpemmons avatar May 29 '25 20:05 dpemmons

Also getting this error quite often

Hugobox avatar Sep 11 '25 20:09 Hugobox