Gemini Fails to Modify .js Files in IDX Workspace (Writes Silently Fail or Show "Retries failed.")

Product: Google IDX
Component: Gemini AI Assistant / File System Integration

Problem Description:

When using the integrated Gemini assistant in Google IDX, I am encountering consistent failures when attempting to apply changes to JavaScript (.js) files within my workspace.

Initially, Gemini would describe the changes it intended to make, state “Now, writing the modified [filename].js…”, but the file content would remain unchanged. There were no error messages in the Gemini chat UI or corresponding error entries in the Gemini or IDX output logs during these silent failures.

More recently, when attempting simple modifications (e.g., adding a comment), Gemini now explicitly reports “Retries failed.” in the chat UI after attempting the modification. Again, the .js file remains unchanged on disk.

This failure occurs even when Gemini correctly handles potential ambiguity. For instance, in scenarios with multiple files sharing the same name, Gemini accurately uses contextual files (like .sh sync scripts in my project) to identify the specific target path (e.g., the development version at …/ZentoGAS/AnthropicClaudeService.js). It successfully reads this specific file, demonstrating correct identification, but the subsequent write operation still fails, resulting in either the silent failure or the “Retries failed.” error.

Interestingly, Gemini is able to successfully read .js files and also successfully read and write changes to Markdown (.md) files in the same workspace. This strongly suggests the issue is specific to the file writing tool execution for .js (and potentially other code) files, occurring after successful file identification and read operations.

Steps to Reproduce:

  1. Open a project in Google IDX containing .js files (potentially with duplicate names in different directories managed by a known structure, e.g., dev/staging/prod).

  2. Open the Gemini chat panel.

  3. Ensure Gemini has context for a specific .js file, possibly referencing the filename generally if duplicates exist (e.g., @workspace modify AnthropicClaudeService.js).

  4. Ask Gemini to make a simple modification, for example: Add the comment // Test change by AI at the very top of AnthropicClaudeService.js

  5. Observe Gemini’s reasoning (it may identify multiple files and choose one based on context) and the final result.

Expected Result:

Gemini should correctly identify the target .js file (using context if needed), confirm the change, and successfully modify the file on disk.

Actual Result:

Gemini correctly identifies the target .js file path and successfully reads it. However, the subsequent write attempt fails. It may either:

  • Claim it is writing the file but make no changes (silent failure).
  • Explicitly report “Retries failed.” in the chat UI.
    In both cases, the target .js file remains unchanged.

Troubleshooting Steps Performed:

  • Confirmed file changes manually after Gemini claimed (or failed) to write.

  • Restarted the IDX workspace multiple times (including browser hard refresh).

  • Checked IDX Output Logs (Gemini, IDX, Extension Host):

    • No specific error messages correlating directly to the silent write failures were found.

    • No specific error messages appear in logs even when the “Retries failed.” message shows in the UI.

    • (Observed unrelated errors in the IDX log regarding npm failing to find package.json during preview startup, path /home/user/zento-recruiter/package.json - potentially indicative of other workspace issues, but read/write works for .md).

  • Simplified requests to basic comment additions.

  • Verified that read operations on .js files work, even after correct disambiguation.

  • Verified that write operations on .md files work.

Impact:

This bug significantly hinders the workflow when using Gemini for code modifications, requiring manual copying and pasting of code generated by the AI, defeating much of the benefit of the integrated tooling.

Request:

Could the IDX team please investigate this issue with the Gemini file modification tool, specifically concerning .js files? The failure occurs even after successful file disambiguation and read operations, pointing strongly to an issue within the write execution step itself. The transition from silent failures to the explicit “Retries failed.” message might provide a clue.

We rely on this functionality and would appreciate an estimated timetable for when a fix might be expected or when further updates on the investigation will be available.

Thank you.

Note: This help ticket was generated with the assistance of analysis provided by Google Gemini, based on input and observed behavior provided by me.

Thanks for this detailed bug report @BenjaminHD. We’ll have our team look into this.

(cc @ali, @ksat)

Hi @kirupac
Thanks for your reply. Do you have any update?
BTW, I have been using IDX in conjunction with Gemini 2.5 in ai Studio and the model is fantastic

How big is your JS file? Are you using Gemini 2.5 in IDX? If so, can you try testing with the default model and seeing if the AI assistance is able to successfully complete the task?

To clarify, I am not using Gemini 2.5 in IDX. I am using Gemini 2.5 in AI Studio and then manually transposing its outputs into IDX.

I am doing this on a file-by-file basis, and I’m not expecting the whole code base to be managed within either platform.

My earlier comment was simply to say that the outputs and analysis prepared and produced by Gemini 2.5 in AI Studio is fantastic.

I am really looking forward to the day that Gemini 2.5 with this capacity is natively embedded in IDX and I can use the tools in IDX.

1 Like

We now have experimental support for Gemini 2.5 Pro in IDX. Please check out Gemini 2.5 Pro Experimental - #3 by ali

1 Like