AI Studio Build agent repeatedly fails with “terminal 1 error running the code” even on simple file reads

I am experiencing a persistent Google AI Studio Build Mode / agent execution problem in an established production project.

The official Google AI Studio status page currently shows “All Systems Operational”, but the Build agent has become highly unreliable.

Environment:

  • Google AI Studio Build Mode
  • Model: Gemini 3.6 Flash
  • Existing, long-running React / TypeScript application
  • The application itself can build successfully
  • Windows desktop

Current symptoms:

  1. The agent frequently stops after only 1–8 seconds with:

    terminal
    1 error running the code

  2. This can happen during extremely simple operations.

For example, I asked the agent only to read package.json and report the application version.

In one attempt it failed immediately.

In a new chat, the same health-check request successfully read the file and correctly reported version 2.0.78, but the UI still showed:

terminal
1 error running the code

after the task had already completed successfully.

  1. The same issue occurs when the agent tries to inspect ordinary source files.

A current example:

I have a runtime bug in:

src/routes/events.$id.reports.tsx

The agent successfully diagnosed the bug:

isPlatformAdmin is referenced but is not defined.

I approved the proposed one-file fix.

However, when asked to implement that very small correction, the agent only managed to read the file and then stopped again with:

terminal
1 error running the code

No edit was performed.

  1. During recent work on the same project I have also intermittently encountered:
  • Invalid argument
  • Canceled
  • Quota limits exceeded
  • Dev server failed to start
  • Repeated dev-server restart attempts
  • Agent runs terminating before edits
  • Difficulty completing Publish operations

In many of these cases the application source itself was valid and the production build succeeded.

  1. The behavior is non-deterministic.

The exact same simple action may fail immediately in one chat and succeed in another chat without any source-code change.

This makes it appear to be an AI Studio Build agent / workspace / tool-execution problem rather than an application-code failure.

Production impact:

This is now blocking safe maintenance of a live application.

A known Reports-screen bug is currently present in the published application. The bug has already been diagnosed and the correction is trivial, but AI Studio is repeatedly unable to complete the actual one-file edit because agent/tool execution terminates.

The instability also makes Publish difficult: repeated attempts may eventually succeed without any code change between attempts.

Expected behavior:

  • The Build agent should be able to reliably read and edit project files.
  • A simple file-read operation should not terminate with a terminal/tool execution error.
  • If an internal AI Studio tool fails, the UI should identify the actual failed tool or platform layer rather than presenting a generic “1 error running the code”.
  • Agent execution should not terminate before an approved small edit can be performed.
  • Successful tasks should not simultaneously display a terminal execution error.

Actual behavior:

  • Agent execution frequently terminates during basic workspace operations.
  • Sometimes the requested operation succeeds but the terminal still reports an error.
  • Sometimes the agent stops before any edit is made.
  • Opening a new chat may temporarily change the behavior, but does not reliably solve it.

The official AI Studio status page currently reports all systems operational.

I can provide the Applet / Project ID privately to a Google team member if needed.

Please investigate whether there is an account-, project-, workspace-, or Build-agent-specific backend failure that is not reflected on the public status page.

Hello @Shlomo_Dvir ,

Can you share some more details with me via DM:

  • Project ID / Billing ID

  • Applet ID where you are seeing these errors.

  • Prompts you are using when this error occurs.

  • Is this happening across all apps or just a specific one?

Hello @Shlomo_Dvir ,
We are looking into this issue and will follow up on this thread.