cline icon indicating copy to clipboard operation
cline copied to clipboard

Character Encoding Error with Multiple Commands Execution

Open JackAdamsJenkins opened this issue 1 year ago • 7 comments

Which API Provider are you using?

Google Gemini

Which Model are you using?

flash

What happened?

Description When the user tries to execute a command that includes multiple chained commands, a character encoding issue occurs.

Example The user is attempting to run the following command:

cd gemini-prompt-enhancer && npm run dev However, the && characters appear to be misinterpreted by the terminal, causing an encoding error.

Environment

  • Operating System: Windows

Additional Context This issue specifically affects the && characters used to chain commands.

Steps to reproduce

  1. Ask Cline to make a program or a change
  2. Cline wants to execute a command

Relevant API REQUEST output

No response

Additional context

No response

JackAdamsJenkins avatar Oct 25 '24 06:10 JackAdamsJenkins

Seems to me as a Google Gemini issue, just tested and ran into the same issue. Other models work fine.

alryks avatar Oct 26 '24 03:10 alryks

@JackAdamsJenkins I suggest to just replace them out in post processing, now that we've done the same to < > and " here https://github.com/cline/cline/blob/4658e5ceadffc1361bb9604e656b2880f083cb3b/src/core/Cline.ts#L1036-L1045

This is really annoying when generating c++ code which uses references.

For furthur solution, maybe it's possible to mention this in system prompt to prevent LLM from outputing HTML entities?

UPD: Created a PR

zjuwyz avatar Oct 30 '24 13:10 zjuwyz

This is still a valid issue. Why is nothing happening?

@canvrno

p30arena avatar Mar 23 '25 14:03 p30arena

@p30arena which model has this occurred with?

canvrno avatar Mar 23 '25 16:03 canvrno

@p30arena which model has this occurred with?

Hi @canvrno it's happening with Gemini 2.0 Flash

p30arena avatar Mar 23 '25 16:03 p30arena

Question is: Why is it working for Anthropic models (Api and LM API) then?

Oh, that's why https://github.com/cline/cline/blob/616d56468f5097cb6ebb14a223bbe2e11730c406/src/utils/string.ts#L6-L13 https://github.com/cline/cline/blob/616d56468f5097cb6ebb14a223bbe2e11730c406/src/core/Cline.ts#L1751-L1755 https://github.com/cline/cline/blob/616d56468f5097cb6ebb14a223bbe2e11730c406/src/core/Cline.ts#L1796-L1800

JKamsker avatar Mar 25 '25 16:03 JKamsker

Same issue. Workaround is to reject gemini's first command, prompt it that rejection was because you need it to replace all "amp&;amp&" with "&&". It then resumes with working commands.

sunlast avatar Mar 27 '25 19:03 sunlast

Hey guys, we pushed a fix on Monday. Please try again, it should be fixed as of the latest version.

frostbournesb avatar Apr 02 '25 01:04 frostbournesb

with v3.17.9 and gemini-2.5-pro-preview-05-06 i still see that same exact issue

pgrandin avatar Jun 04 '25 17:06 pgrandin