Repeated “Invalid argument” errors in Google AI Studio Build agent

Title: Repeated “Invalid argument” errors in Google AI Studio Build agent

Hello,

I am repeatedly encountering “Invalid argument” errors while using Gemini 3.6 Flash in the Google AI Studio Build environment.

The error usually occurs after the agent has already completed an action successfully, such as:

  • Reading or editing project files

  • Running Gradle or Maven commands

  • Creating a checkpoint

  • Starting or checking a background process

  • Completing a build or test command

After completing the action, the agent becomes “Canceled” and displays one of these messages:

  • “Invalid argument”

  • “Agent execution terminated due to error”

  • “There was an unexpected error. Finish what you were doing.”

  • “Errors running the code”

In some cases, the terminal shows BUILD SUCCESSFUL before the “Invalid argument” message appears. This suggests the error may occur while the agent is checking task status or generating its final response, rather than inside the project build.

Steps to reproduce:

  1. Open an existing project in Google AI Studio Build.

  2. Ask Gemini to inspect or edit a small number of files.

  3. Ask it to run a Gradle or Maven build.

  4. Wait for the command to finish or for the agent to check its status.

  5. The agent becomes canceled and displays “Invalid argument.”

Troubleshooting already attempted:

  • Refreshed Google AI Studio

  • Retried the request

  • Started a new chat in the same project

  • Reduced prompts to one operation at a time

  • Separated editing, compilation and testing

  • Used shorter terminal commands

  • Ran longer compilation tasks in the background

The problem continues and makes it difficult to verify completed builds. Repeated attempts also consume the daily agent usage limit.

Environment:

  • Google AI Studio Build

  • Gemini 3.6 Flash

  • Android Kotlin/Jetpack Compose project

  • Spring Boot backend

  • Gradle and Maven build systems

  • Google Chrome on Windows

Expected result:

The agent should complete the requested operation and provide its final report without canceling.

Actual result:

The operation may complete successfully, but the agent subsequently terminates with “Invalid argument.”

Is this a known issue with Google AI Studio Build tool calls, background-task tracking or final response generation? Please let me know if additional sanitized logs are required.

Thank you.