gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

[Bug] /chat save command silently fails on invalid tags

Open flowernotfound opened this issue 1 year ago • 3 comments

What happened?

When using the /chat save command with a tag that is invalid as a filename (e.g., containing path traversal characters like ../), the command fails to save the conversation checkpoint. Despite this failure, the user interface incorrectly displays a success message, such as Conversation checkpoint saved with tag: ../invalid-tag..

Image

What did you expect to happen?

I expected one of two outcomes when providing an invalid tag:

  1. Validation Error: The command should validate the tag argument before attempting to save. If the tag contains characters that are invalid for a filename, it should reject the input and display an informative error message to the user, such as:

Error: Invalid tag. Only letters, numbers, hyphens, and underscores are allowed.

  1. Save Failure Notification: If the file writing operation fails for any reason (including an invalid path), the UI should report this failure accurately instead of showing a success message. The expected message would be:

Error: Failed to save conversation with tag "".  Please use a valid filename.

Client information

$ gemini /about
About Gemini CLI
CLI Version 0.1.7
Git Commit  55cc809
Model       gemini-2.5-pro
Sandbox     no sandbox
OS          darwin
Auth Method OAuth

Login information

Google Account.

Anything else we need to know?

No response

flowernotfound avatar Jul 01 '25 10:07 flowernotfound

I can take a look later today

sethtroisi avatar Jul 01 '25 17:07 sethtroisi

Found possible duplicate issues:

  • #4903: (0.932273681895358)
  • #3384: (0.9120098896032522)
  • #3523: (0.9098217433584792)

gsquared94 avatar Jul 30 '25 06:07 gsquared94

Hi @flowernotfound, i believe this issue has been fixed. I'm going to close this for now, but please feel free to reopen it if you still run into this problem on the latest version.

galdawave avatar Aug 22 '25 19:08 galdawave