go panic when restoring session #1379

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

Originally created by @khimaros on GitHub (Aug 19, 2025).

Originally assigned to: @rekram1-node on GitHub.

this happened while making some edits and ended up repeating any time i try to restore that session

Caught panic:

runtime error: index out of range [0] with length 0

Restoring terminal...

goroutine 190 [running]:
runtime/debug.Stack()
	/opt/hostedtoolcache/go/1.24.6/x64/src/runtime/debug/stack.go:26 +0x5e
github.com/charmbracelet/bubbletea/v2.(*Program).recoverFromPanic(0xc0001d1200, {0xd1dd60, 0xc000477e48})
	/home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.4/tea.go:1139 +0x165
github.com/charmbracelet/bubbletea/v2.(*Program).handleCommands.func1.1.1()
	/home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.4/tea.go:479 +0x3a
panic({0xd1dd60?, 0xc000477e48?})
	/opt/hostedtoolcache/go/1.24.6/x64/src/runtime/panic.go:792 +0x132
github.com/sst/opencode/internal/app.(*App).Keybind(...)
	/home/runner/work/opencode/opencode/packages/tui/internal/app/app.go:210
github.com/sst/opencode/internal/components/chat.renderToolDetails(_, {{0xc002afe807, 0x1e}, {0xc002afe8a7, 0x1e}, {0xc002afe834, 0x1e}, {0xc002afe861, 0x1e}, {{0xc002b0800b, ...}, ...}, ...}, ...)
	/home/runner/work/opencode/opencode/packages/tui/internal/components/chat/message.go:668 +0x3847
github.com/sst/opencode/internal/components/chat.(*messagesComponent).renderView.func2()
	/home/runner/work/opencode/opencode/packages/tui/internal/components/chat/messages.go:571 +0x4b67
github.com/charmbracelet/bubbletea/v2.(*Program).handleCommands.func1.1()
	/home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.4/tea.go:484 +0x7d
created by github.com/charmbracelet/bubbletea/v2.(*Program).handleCommands.func1 in goroutine 100
	/home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.4/tea.go:474 +0x131
Originally created by @khimaros on GitHub (Aug 19, 2025). Originally assigned to: @rekram1-node on GitHub. this happened while making some edits and ended up repeating any time i try to restore that session ``` Caught panic: runtime error: index out of range [0] with length 0 Restoring terminal... goroutine 190 [running]: runtime/debug.Stack() /opt/hostedtoolcache/go/1.24.6/x64/src/runtime/debug/stack.go:26 +0x5e github.com/charmbracelet/bubbletea/v2.(*Program).recoverFromPanic(0xc0001d1200, {0xd1dd60, 0xc000477e48}) /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.4/tea.go:1139 +0x165 github.com/charmbracelet/bubbletea/v2.(*Program).handleCommands.func1.1.1() /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.4/tea.go:479 +0x3a panic({0xd1dd60?, 0xc000477e48?}) /opt/hostedtoolcache/go/1.24.6/x64/src/runtime/panic.go:792 +0x132 github.com/sst/opencode/internal/app.(*App).Keybind(...) /home/runner/work/opencode/opencode/packages/tui/internal/app/app.go:210 github.com/sst/opencode/internal/components/chat.renderToolDetails(_, {{0xc002afe807, 0x1e}, {0xc002afe8a7, 0x1e}, {0xc002afe834, 0x1e}, {0xc002afe861, 0x1e}, {{0xc002b0800b, ...}, ...}, ...}, ...) /home/runner/work/opencode/opencode/packages/tui/internal/components/chat/message.go:668 +0x3847 github.com/sst/opencode/internal/components/chat.(*messagesComponent).renderView.func2() /home/runner/work/opencode/opencode/packages/tui/internal/components/chat/messages.go:571 +0x4b67 github.com/charmbracelet/bubbletea/v2.(*Program).handleCommands.func1.1() /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.4/tea.go:484 +0x7d created by github.com/charmbracelet/bubbletea/v2.(*Program).handleCommands.func1 in goroutine 100 /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.4/tea.go:474 +0x131 ```
yindo closed this issue 2026-02-16 17:30:41 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Aug 19, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #991: Very similar panic when restoring a session with same stack trace in renderToolDetails and message.go, also repeats on every restore attempt

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Aug 19, 2025): This issue might be a duplicate of existing issues. Please check: - #991: Very similar panic when restoring a session with same stack trace in renderToolDetails and message.go, also repeats on every restore attempt Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Aug 19, 2025):

will fix

@rekram1-node commented on GitHub (Aug 19, 2025): will fix
Author
Owner

@rekram1-node commented on GitHub (Aug 19, 2025):

@khimaros out of curiousity can you share your keybind settings?

I can fix the panic easily but Idk the root cause of it your keybind may provide more detail to source of it

@rekram1-node commented on GitHub (Aug 19, 2025): @khimaros out of curiousity can you share your keybind settings? I can fix the panic easily but Idk the root cause of it your keybind may provide more detail to source of it
Author
Owner

@khimaros commented on GitHub (Aug 19, 2025):

  "keybinds": {
    "session_child_cycle": "none",
    "session_child_cycle_reverse": "none"
  }
@khimaros commented on GitHub (Aug 19, 2025): ```json "keybinds": { "session_child_cycle": "none", "session_child_cycle_reverse": "none" } ```
Author
Owner

@rekram1-node commented on GitHub (Aug 19, 2025):

sweet ty!

@rekram1-node commented on GitHub (Aug 19, 2025): sweet ty!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1379