• AgentArmor teamTeam2d agoNeeds helpSolved

    Why does Cline show duplicate assistant responses, and does it double my API token cost?

    Cline shows the same assistant message two or three times in the chat, and OpenRouter usage looks higher than expected. Reporters used Cline 3.7.1 on macOS with Sonnet 3.5, Gemini 2.5, and DeepSeek, and asked whether the duplicates are separate billed requests.

    Originally asked on GitHub: https://github.com/cline/cline/issues/2350

    4 answers

    • Best answerAgentArmor teamTeam2d ago

      Status: explained. The issue was closed as completed, but the thread does not show a confirmed code fix. A maintainer said the problem seems tied to how the model calls and uses tools, suggested a system prompt tweak, and asked for reliable reproduction steps plus a PR. A contributor also said they thought it very unlikely the duplicates were billed as extra inference.

      What the thread found:

      • One user exported task history and saw a Gemini 2.5 or DeepSeek response written both outside and inside the plan_mode_respond tool call, in Plan Mode.
      • Another user checked api_conversation_history.json and found <thinking> tags from a model without thinking enabled. They suspected the Plan Mode chat carried into Act Mode, where the model imitated the tags.
      • Restarting VS Code seemed to stop the duplicates for one user, who was not sure it was the real remedy.
      • One user asked Gemini 2.5 Pro in chat to stop making duplicate API requests, and the duplicates stopped for them. This is a model-behavior workaround, not a Cline fix.

      To check your own task, open api_conversation_history.json in the task folder and look for repeated text or <thinking> tags in assistant messages. Reports came from several providers and both Plan and Act modes, so the thread does not confirm one cause.

      Did this work for you?
    • AgentArmor teamTeam2d ago

      What @mahe993 tried on GitHub (Worked)

      Asked Gemini 2.5 Pro in the chat to stop making duplicated API requests. The duplicates stopped for this user, though the model said the issue was with the platform it ran on.

      Source: https://github.com/cline/cline/issues/2350#issuecomment-2819929833 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam2d ago

      What @itworkslol tried on GitHub (Outcome unclear)

      Checked api_conversation_history.json and found tags in an assistant message from a model without thinking enabled. Suspected the Plan Mode chat carried into Act Mode and the model imitated the tags.

      Source: https://github.com/cline/cline/issues/2350#issuecomment-2746128740 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam2d ago

      What @dcbartlett tried on GitHub (Outcome unclear)

      Restarted VS Code after seeing duplicates. The user said it seemed to correct the behavior but doubted the restart was the actual remedy.

      Source: https://github.com/cline/cline/issues/2350#issuecomment-2752969895 (opens external site)

      Did this work for you?

    Add your answer or comment