Skip to content

Gemini uses double quotes in bash commands, causing issues (and could cause inadvertent command execution) #4104

@akx

Description

@akx

What happened?

 Would you like me to commit these changes?

> Sure.

 ╭
 │ ✔  Shell git status (Check the current git status.)
 │
 │    On branch wah
 │    Changes not staged for commit:
 │      (use "git add <file>..." to update what will be committed)
 │      (use "git restore <file>..." to discard changes in working directory)
 │      modified:   kollaasi_cli/src/main.rs
 │      modified:   kollaasi_core/src/lib.rs
 │      modified:   kollaasi_gui/src/main.rs
 │
 │    no changes added to commit (use "git add" and/or "git commit -a")
 │
 ╰
 ╭
 │ ✔  Shell git add kollaasi_cli/src/main.rs kollaasi_core/src/lib.rs kollaasi_gui/src/main.rs (Stage the modified files.)
 ╰
 ╭
 │ ✔  Shell git commit -m "Refactor: Replace unique boolean with unique_penalty float
 │
 │    This commit refactors the …
 │
 │    bash: unique: command not found
 │    bash: MosaicParams: command not found
 │    bash: unique_penalty: command not found
 │    bash: MosaicParams: command not found
 │    bash: kollaasi_core: command not found
 │    bash: create_mosaic: command not found
 │    bash: find_best_match: command not found
 │    bash: kollaasi_core: command not found
 │    bash: unique_penalty: command not found
 │    bash: kollaasi_cli: command not found
 │    bash: kollaasi_gui: command not found
 │    bash: MosaicParams: command not found
 │    [wah 3403bed] Refactor: Replace unique boolean with unique_penalty float
 │     3 files changed, 18 insertions(+), 15 deletions(-)
 │
 ╰
 ╭
 │ ✔  Shell git status (Verify the commit.)
 │
 │    On branch wah
 │    nothing to commit, working tree clean
 │
 ╰
✦ The changes have been committed successfully.

and the resulting commit message is

    Refactor: Replace unique boolean with unique_penalty float

    This commit refactors the  boolean parameter in  to a  float. This allows for more granular control over the penalty applied for reusing tiles, enabling adjustment of its strength.

    - Updated  struct in .
    - Modified  and  functions in  to use the new .
    - Updated  and  to reflect the change in .

What did you expect to happen?

The model to have been more careful with bash quotes (or used a method where no shell can misinterpret the commit message's contents as shell metacharacters).

Client information

  • CLI Version: 0.1.4
  • Git Commit: 1078a54
  • Operating System: darwin v24.2.0
  • Sandbox Environment: no sandbox
  • Model Version: gemini-2.5-flash
  • Memory Usage: 319.0 MB

Login information

No response

Anything else we need to know?

No response

Metadata

Metadata

Assignees

Labels

area/coreIssues related to User Interface, OS Support, Core Functionalitypriority/p1Important and should be addressed in the near term.

Type

No fields configured for Bug.

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions