xenodium / chatgpt-shell

A multi-llm Emacs shell (ChatGPT, Claude, Gemini) + editing integrations
https://xenodium.com
GNU General Public License v3.0
855 stars 76 forks source link

Bug: Failed to start the `chatgpt-shell` when the `chatgpt-shell-system-prompt` set to nil #235

Closed ccqpein closed 1 month ago

ccqpein commented 1 month ago

I just cannot start the chatgpt-shell today. And the error log is below after I (setq debug-on-error t)

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-trim-right(nil nil)
  string-trim(nil)
  chatgpt-shell--shrink-model-version(nil)
  chatgpt-shell--shell-info()
  chatgpt-shell--prompt-pair()
  chatgpt-shell-start(nil nil)
  chatgpt-shell(nil)
  funcall-interactively(chatgpt-shell nil)
  command-execute(chatgpt-shell record)
  helm-M-x-execute-command(chatgpt-shell)
...

After some study, I found https://github.com/xenodium/chatgpt-shell/blob/c845ada7074271b44a458043fbe3f160cfd7956e/chatgpt-shell.el#L583 update the chatgpt-shell-model-version with the chatgpt-shell-system-prompt. I manually set the chatgpt-shell-system-prompt to nil because I personally don't want to give system prompt when I startup the conversation with chatgpt.

Then I found this line looks like some typo or copy/paste issue. I checked the PR #232 that changed this line. I guess you want the chatgpt-shell-model-version instead of the chatgpt-shell-system-prompt?

ccqpein commented 1 month ago

Merged