Agent hung for 6 hours without progress or task handover

I initiated a workflow and monitored it for the first 10 minutes, where it appeared to function normally. I then queued a subsequent task and left the agent running. Upon returning 6 hours later, I discovered that:

  1. The agent completely froze shortly after the initial 10 minutes, generating zero progress or output for nearly 6 hours.

  2. The queued task was never triggered, despite the pipeline being locked and active the entire time.

  3. Severe Quota Waste: This freeze needlessly burned 20% of my 5-hour limit on absolutely zero output or progress.

  4. This resulted in a massive waste of execution time, quota/credits, and completely disrupted my project schedule.

To get it to resume working, I have to manually interrupt it and tell it to continue. After doing so, it enters a loop with the following error:

Stop hook blocked termination: You are still working toward the user's goal. Do not stop until the task is fully complete. Time spent so far: 9h 12m Continuation: #1

Then, I have to interrupt it a second time and tell it to continue again before it actually proceeds

Hi @Mohamed_Haythem , Welcome to the Forum,

Could you please follow these steps:

  1. Send this exact prompt to the agent:

    “Cancel current goal immediately. Terminate all background tasks and do not trigger stop hooks.” (Or click the Stop button and manually kill stuck processes in the Auxiliary Pane → Background Tasks tab).

  2. Temporarily remove or disable any stop hooks defined in your project’s .agents/hooks.json or ~/.gemini/config/hooks.json.

  3. When launching long-running commands, instruct the agent to use timeouts (e.g. “Run tests with a 60s timeout”), and avoid stacking queued tasks while an unattended /goal run is in progress.

Please try sending the cancel prompt and let us know if the loop breaks!

Thanks! I ended up switching over to 3.7 Flash and haven’t encountered these issues at all. It doesn’t quite match the raw power of 3.8, but it gets the job done without hanging.