Deleted a few sessions and now opencode crashes on prompt #858

Closed
opened 2026-02-16 17:28:34 -05:00 by yindo · 5 comments
Owner

Originally created by @demosten on GitHub (Jul 22, 2025).

Originally assigned to: @adamdotdevin on GitHub.

Using mac os.
Using opencode v0.3.54 installed via curl
Using Copilot (initial configuration) and local Ollama (project configuration though it looks like copilot is still accessible)

I've deleted all existent sessions, then created a new one. Once in the new session I tried to send a simple prompt and got:

Caught panic:

runtime error: invalid memory address or nil pointer dereference

Restoring terminal...

goroutine 1 [running]:
runtime/debug.Stack()
	/opt/hostedtoolcache/go/1.24.4/x64/src/runtime/debug/stack.go:26 +0x64
github.com/charmbracelet/bubbletea/v2.(*Program).recoverFromPanic(0x140001a7000, {0x1018a15e0, 0x101ec7cf0})
	/home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.4/tea.go:1139 +0x10c
github.com/charmbracelet/bubbletea/v2.(*Program).Run.func2()
	/home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.4/tea.go:872 +0xdc
panic({0x1018a15e0?, 0x101ec7cf0?})
	/opt/hostedtoolcache/go/1.24.4/x64/src/runtime/panic.go:792 +0x124
github.com/sst/opencode/internal/app.Prompt.ToMessage({{0x1400300ca00, 0xa8}, {0x140000d4420, 0x1, 0x1}}, {0x14002f4d4c0, 0x1e}, {0x140032b4797, 0x1e})
	/home/runner/work/opencode/opencode/packages/tui/internal/app/prompt.go:69 +0x4f8
github.com/sst/opencode/internal/app.(*App).SendPrompt(0x1400013eb08, {0x10197c598, 0x101f2a420}, {{0x1400300ca00, 0xa8}, {0x140000d4420, 0x1, 0x1}})
	/home/runner/work/opencode/opencode/packages/tui/internal/app/app.go:473 +0x1d0
github.com/sst/opencode/internal/tui.appModel.Update({0x74, 0x18, 0x1400013eb08, {0x0, 0x0}, {0x148d0fe38, 0x14000256e00}, {0x101981ea0, 0x14001f08008}, {0x101980a20, ...}, ...}, ...)
	/home/runner/work/opencode/opencode/packages/tui/internal/tui/tui.go:335 +0x21b0
github.com/charmbracelet/bubbletea/v2.(*Program).eventLoop(0x140001a7000, {0x101979410?, 0x14001f16a88?}, 0x140000e20e0)
	/home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.4/tea.go:768 +0x1438
github.com/charmbracelet/bubbletea/v2.(*Program).Run(0x140001a7000)
	/home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.4/tea.go:1024 +0xb10
main.main()
	/home/runner/work/opencode/opencode/packages/tui/cmd/opencode/main.go:111 +0x778

Restart didn't help. Now it always crashes. Even after I change models or folders.

I love this project!

Originally created by @demosten on GitHub (Jul 22, 2025). Originally assigned to: @adamdotdevin on GitHub. Using mac os. Using opencode v0.3.54 installed via curl Using Copilot (initial configuration) and local Ollama (project configuration though it looks like copilot is still accessible) I've deleted all existent sessions, then created a new one. Once in the new session I tried to send a simple prompt and got: ``` Caught panic: runtime error: invalid memory address or nil pointer dereference Restoring terminal... goroutine 1 [running]: runtime/debug.Stack() /opt/hostedtoolcache/go/1.24.4/x64/src/runtime/debug/stack.go:26 +0x64 github.com/charmbracelet/bubbletea/v2.(*Program).recoverFromPanic(0x140001a7000, {0x1018a15e0, 0x101ec7cf0}) /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.4/tea.go:1139 +0x10c github.com/charmbracelet/bubbletea/v2.(*Program).Run.func2() /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.4/tea.go:872 +0xdc panic({0x1018a15e0?, 0x101ec7cf0?}) /opt/hostedtoolcache/go/1.24.4/x64/src/runtime/panic.go:792 +0x124 github.com/sst/opencode/internal/app.Prompt.ToMessage({{0x1400300ca00, 0xa8}, {0x140000d4420, 0x1, 0x1}}, {0x14002f4d4c0, 0x1e}, {0x140032b4797, 0x1e}) /home/runner/work/opencode/opencode/packages/tui/internal/app/prompt.go:69 +0x4f8 github.com/sst/opencode/internal/app.(*App).SendPrompt(0x1400013eb08, {0x10197c598, 0x101f2a420}, {{0x1400300ca00, 0xa8}, {0x140000d4420, 0x1, 0x1}}) /home/runner/work/opencode/opencode/packages/tui/internal/app/app.go:473 +0x1d0 github.com/sst/opencode/internal/tui.appModel.Update({0x74, 0x18, 0x1400013eb08, {0x0, 0x0}, {0x148d0fe38, 0x14000256e00}, {0x101981ea0, 0x14001f08008}, {0x101980a20, ...}, ...}, ...) /home/runner/work/opencode/opencode/packages/tui/internal/tui/tui.go:335 +0x21b0 github.com/charmbracelet/bubbletea/v2.(*Program).eventLoop(0x140001a7000, {0x101979410?, 0x14001f16a88?}, 0x140000e20e0) /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.4/tea.go:768 +0x1438 github.com/charmbracelet/bubbletea/v2.(*Program).Run(0x140001a7000) /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.4/tea.go:1024 +0xb10 main.main() /home/runner/work/opencode/opencode/packages/tui/cmd/opencode/main.go:111 +0x778 ``` Restart didn't help. Now it always crashes. Even after I change models or folders. I love this project!
yindo closed this issue 2026-02-16 17:28:35 -05:00
Author
Owner

@thdxr commented on GitHub (Jul 22, 2025):

does deleting ~/.local/share/opencode fix anything? not sure what's going on here

@thdxr commented on GitHub (Jul 22, 2025): does deleting `~/.local/share/opencode` fix anything? not sure what's going on here
Author
Owner

@adamdotdevin commented on GitHub (Jul 22, 2025):

i made this code more defensive, but confused how you got in this state; did your prompt have any attachments in it? (files)

@adamdotdevin commented on GitHub (Jul 22, 2025): i made this code more defensive, but confused how you got in this state; did your prompt have any attachments in it? (files)
Author
Owner

@adamdotdevin commented on GitHub (Jul 23, 2025):

@demosten after upgrading to latest, is this fixed for you?

@adamdotdevin commented on GitHub (Jul 23, 2025): @demosten after upgrading to latest, is this fixed for you?
Author
Owner

@demosten commented on GitHub (Jul 24, 2025):

@adamdotdevin after the update it no longer crashes! I did not delete ~/.local/share/opencode.

@demosten commented on GitHub (Jul 24, 2025): @adamdotdevin after the update it no longer crashes! I did not delete `~/.local/share/opencode`.
Author
Owner

@rekram1-node commented on GitHub (Dec 27, 2025):

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

@rekram1-node commented on GitHub (Dec 27, 2025): [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#858