cline icon indicating copy to clipboard operation
cline copied to clipboard

Generates wrong Mac commands with & instead of a simple &

Open udiedrichsen opened this issue 9 months ago • 2 comments

What happened?

All commands are generated wrong.

Eg

cd src/frontend && npx shadcn-ui@latest add progress

Instead of

cd src/frontend && npx shadcn-ui@latest add progress

And it is hard to teach cline that it is using outdated commands:

The 'shadcn-ui' package is deprecated. Please use the 'shadcn' package instead:

npx shadcn@latest add progress

For more information, visit: https://ui.shadcn.com/docs/cli

Steps to reproduce

Relevant API REQUEST output


Operating System

macOS 15.3.2

Cline Version

3.8.3

Additional context

No response

udiedrichsen avatar Mar 27 '25 08:03 udiedrichsen

Same for Linux (ubuntu)

GaryOcean428 avatar Mar 27 '25 23:03 GaryOcean428

@udiedrichsen we are looking into this issue. In the meantime, I've solved this on my end by adding the following to the Custom Instructions:

When running terminal commands, never use "&" to represent "&"

trevhud avatar Mar 28 '25 05:03 trevhud

I am getting this only with latest gemini 2.5. I investigated this with gemini and got an answer that LLM is confused by the fact that tool call is an xml block and so it automatically escapes ampersands for proprer xml :)

ciekawy avatar Mar 30 '25 05:03 ciekawy

Unfortunately I can confirm that this workaround "When running terminal commands, never use "&" to represent "&""does not work consistently on Gemini 2.5 - it does reduce the error but does not remove it completely.

appscaptain avatar Mar 31 '25 10:03 appscaptain

same here... I don't understand why this isn't a priority for anyone else. Are others not experiencing this result?

ladonteprince avatar Mar 31 '25 14:03 ladonteprince

The thing is ... this is problem of LLM... OR confusing standard yet this would require full rewrite for all tools. It seems tool calling schema is XML-like yet there is no requirement to escape which actually is binary - and for some LLMs this may be super awkward to generate actually invalid XML.

ciekawy avatar Mar 31 '25 15:03 ciekawy

One option could a a switch for the tool calling schema - per model to use full escape mode

ciekawy avatar Mar 31 '25 15:03 ciekawy

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