The agent then retries repeatedly until you stop it, consuming credits as it goes.
To mitigate: some users have suggested telling the AI to only ever make one edit per tool call can help. The theory here is that the edit tool itself has a concurrency bug and Claude 3.7 tries to do simultaneous edits with their system prompt.
Regardless - if you're a Windsurf user it is NOT just you and REALLY pay attention to credit consumption, many reports suggest it will just keep trying and charging.