Skip to content

Agent requests can loop, ignore Stop, and cost far more than needed #9576

Open

Description

@sshiv012

What happened?

Agent requests can run far longer, and cost far more, than they should:

  • An agent can keep adding or editing operators round after round without finishing.
  • Pressing Stop doesn't always halt it, and it can keep running after the tab is closed or the agent is deleted.
  • Even normal requests are expensive. At every step the agent resends the whole conversation and workflow, rebuilt from scratch, so the model provider rarely reuses what it already processed (low prompt cache hit rate). The workflow is also re-checked and re-run after every edit. Cost and wait time grow quickly with each step, and a looping agent multiplies all of it.

Expected:

  • Each request has sensible limits on steps, time and cost. When the agent hits a limit, it tells the user instead of silently continuing.
  • Stop always works, and closing or deleting an agent ends its work.
  • Unchanged context is reused between steps so cached input is used, and repeated workflow checks and runs that aren't needed are skipped.
  • Token usage and cache hit rate are visible per conversation.

Target: release 1.4. Needed by Nov 26, 2026 (4 days before the release).

Related: #9455

How to reproduce?

  1. Create an agent and give it a multi-step task (for example, building a workflow with several operators).
  2. Watch the number of model calls and tokens per request; some requests keep going for many rounds.
  3. Press Stop while it is running, or send a second message before the first finishes, and observe that work may continue.
  4. Close the tab or delete the agent mid-run and observe that usage may continue.

Version/Branch

1.4.0-incubating-SNAPSHOT (main)

Activity

  1. github-actions commented on Nov 20, 2026

    @github-actions
    Contributor

    👋 Thanks for opening this issue, @sshiv012!

    It looks like the issue description doesn't quite follow our template yet:

    • This issue doesn't appear to use one of our templates (Bug, Feature, or Task). Please open it using a template so the required details are captured.

    Filling out the template helps reviewers understand and triage your contribution faster. Please edit the description to complete it. This message will disappear automatically once the template is followed.

    You can find the template prompts by editing the description, or see CONTRIBUTING.md for the full contribution flow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions