Skip to content

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

Closed

Description

@demosten

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!

Activity

  1. changed the title [-]Deleted a few sessions and now opencode crashes on request[/-] [+]Deleted a few sessions and now opencode crashes on prompt[/+] on Jul 22, 2025
  2. thdxr commented on Jul 22, 2025

    @thdxr
    Member

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

  3. assigned and unassigned on Jul 22, 2025
  4. adamdotdevin commented on Jul 22, 2025

    @adamdotdevin
    Member

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

  5. adamdotdevin commented on Jul 23, 2025

    @adamdotdevin
    Member

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

  6. demosten commented on Jul 24, 2025

    @demosten
    Author

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

  7. rekram1-node commented on Dec 28, 2025

    @rekram1-node
    Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions