mods icon indicating copy to clipboard operation
mods copied to clipboard

Couldn't start Bubble Tea program message after enter a prompt

Open AmiraliToori opened this issue 6 months ago • 4 comments

Describe the bug

Crash when I choose a model and enter the prompt. The chosen model are related to "google-gemini".

Here is the output:

Caught goroutine panic:

                       runtime error: invalid memory address or nil pointer dereference

                                                                                       Restoring terminal...

             goroutine 123 [running]:
                                     runtime/debug.Stack()
                                                                /opt/hostedtoolcache/go/1.24.4/x64/src/runtime/debug/stack.go:26 +0x5e
                                       runtime/debug.PrintStack()
                                                                        /opt/hostedtoolcache/go/1.24.4/x64/src/runtime/debug/stack.go:18 +0x13
                                               github.com/charmbracelet/bubbletea.(*Program).recoverFromGoPanic(0xc0001fb180, {0x1298040, 0x2357920})
                                                        /home/runner/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:822 +0xab
                                           github.com/charmbracelet/bubbletea.(*Program).handleCommands.func1.1.1()
                        /home/runner/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:360 +0x3a
           panic({0x1298040?, 0x2357920?})
                                                /opt/hostedtoolcache/go/1.24.4/x64/src/runtime/panic.go:792 +0x132
                   bufio.(*Reader).ReadSlice(0x0, 0xa)
                                                        /opt/hostedtoolcache/go/1.24.4/x64/src/bufio/bufio.go:355 +0x3d
                        bufio.(*Reader).collectFragments(0x0, 0xa)
                                                                        /opt/hostedtoolcache/go/1.24.4/x64/src/bufio/bufio.go:455 +0x70
                                        bufio.(*Reader).ReadBytes(0xc00215b200?, 0x1?)
                                                                                        /opt/hostedtoolcache/go/1.24.4/x64/src/bufio/bufio.go:482 +0x17
                                                        github.com/charmbracelet/mods/internal/google.(*Stream).Current(0xc000486000)
                                        /home/runner/go/pkg/mod/github.com/charmbracelet/[email protected]/internal/google/google.go:239 +0x4c
                                         main.(*Mods).receiveCompletionStreamCmd.func1()
                                                                                              /home/runner/go/pkg/mod/github.com/charmbracelet/[email protected]/mods.go:510 +0x5e
                                                                             main.(*Mods).Update.(*Mods).startCompletionCmd.func1()
                                        /home/runner/go/pkg/mod/github.com/charmbracelet/[email protected]/mods.go:467 +0x1611
                         github.com/charmbracelet/bubbletea.(*Program).handleCommands.func1.1()
                                                                                              /home/runner/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:365 +0x7d
                                                                                 created by github.com/charmbracelet/bubbletea.(*Program).handleCommands.func1 in goroutine 122
                                                                                        /home/runner/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:355 +0x131

   ERROR  Couldn't start Bubble Tea program.

  program was killed: program experienced a panic

Setup

  • Linux Kubuntu 24.04 LTS
  • Bash 6.8.0-60-generic
  • WezTerm 20240203-110809-5046fc22
  • WezTerm

To Reproduce

Steps to reproduce the behavior:

  1. 'mods -M'
  2. Choose one of the Google models
  3. Enter some prompt
  4. See error

AmiraliToori avatar Jul 12 '25 08:07 AmiraliToori

I saw the same thing on my machine. Did some debugging, and found out that internally it reports an error here. But due to something-I-didn't-debug, this error fails to print (perhaps it panics inside the Error() function or something).

Anyway, for me that error was that I got a 404 when mods contacted google, and it turned out I had a reference in my settings file (see it with mods --settings) to a now-removed version of gemini-2.5-flash-preview-04-17. I changed that to just gemini-2.5-flash and I was good to go. Maybe that could work for you too, @AmiraliToori ?

torarvid avatar Jul 28 '25 08:07 torarvid

I fixed the name of the models before; here is a section of mods --settings: Image

@torarvid, unfortunately, the issue persists.

AmiraliToori avatar Jul 28 '25 09:07 AmiraliToori

gemini-1.5-pro-latest does not exist

sedlund avatar Jul 28 '25 10:07 sedlund

I tried comment the gemini-1.5-pro-latest and gemini-1.5-flash-latest, but The problem still exists.

AmiraliToori avatar Aug 01 '25 08:08 AmiraliToori