Terminal crashed #1552

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

Originally created by @JoshuaRileyDev on GitHub (Sep 1, 2025).

Originally assigned to: @rekram1-node on GitHub.

Caught panic:

runtime error: slice bounds out of range [175:174]

Restoring terminal...

goroutine 1 [running]:
runtime/debug.Stack()
/opt/hostedtoolcache/go/1.24.6/x64/src/runtime/debug/stack.go:26 +0x64
github.com/charmbracelet/bubbletea/v2.(*Program).recoverFromPanic(0x14002082000, {0x102ca3a40, 0x140000265e8})
/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({0x102ca3a40?, 0x140000265e8?})
/opt/hostedtoolcache/go/1.24.6/x64/src/runtime/panic.go:792 +0x124
github.com/sst/opencode/internal/app.Prompt.ToMessage({{0x14002998001, 0xae}, {0x14003b852c0, 0x2, 0x2}}, {0x1400326e7e0, 0x1e}, {0x140025d00b7, 0x1e})
/home/runner/work/opencode/opencode/packages/tui/internal/app/prompt.go:46 +0xa1c
github.com/sst/opencode/internal/app.(*App).SendPrompt(0x140003f0488, {0x102d07838, 0x1032d6e60}, {{0x14002998001, 0xae}, {0x14003b852c0, 0x2, 0x2}})
/home/runner/work/opencode/opencode/packages/tui/internal/app/app.go:780 +0x1a8
github.com/sst/opencode/internal/tui.Model.Update({{0x0, 0x0}, {0x0, 0x0}, 0x80, 0x2d, 0x140003f0488, {0x0, 0x0}, {0x102d07df8, ...}, ...}, ...)
/home/runner/work/opencode/opencode/packages/tui/internal/tui/tui.go:408 +0x1ddc
github.com/charmbracelet/bubbletea/v2.(*Program).eventLoop(0x14002082000, {0x102d042c0?, 0x14002080000?}, 0x1400041c380)
/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(0x14002082000)
/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:146 +0xb24

Originally created by @JoshuaRileyDev on GitHub (Sep 1, 2025). Originally assigned to: @rekram1-node on GitHub. Caught panic: runtime error: slice bounds out of range [175:174] Restoring terminal... goroutine 1 [running]: runtime/debug.Stack() /opt/hostedtoolcache/go/1.24.6/x64/src/runtime/debug/stack.go:26 +0x64 github.com/charmbracelet/bubbletea/v2.(*Program).recoverFromPanic(0x14002082000, {0x102ca3a40, 0x140000265e8}) /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({0x102ca3a40?, 0x140000265e8?}) /opt/hostedtoolcache/go/1.24.6/x64/src/runtime/panic.go:792 +0x124 github.com/sst/opencode/internal/app.Prompt.ToMessage({{0x14002998001, 0xae}, {0x14003b852c0, 0x2, 0x2}}, {0x1400326e7e0, 0x1e}, {0x140025d00b7, 0x1e}) /home/runner/work/opencode/opencode/packages/tui/internal/app/prompt.go:46 +0xa1c github.com/sst/opencode/internal/app.(*App).SendPrompt(0x140003f0488, {0x102d07838, 0x1032d6e60}, {{0x14002998001, 0xae}, {0x14003b852c0, 0x2, 0x2}}) /home/runner/work/opencode/opencode/packages/tui/internal/app/app.go:780 +0x1a8 github.com/sst/opencode/internal/tui.Model.Update({{0x0, 0x0}, {0x0, 0x0}, 0x80, 0x2d, 0x140003f0488, {0x0, 0x0}, {0x102d07df8, ...}, ...}, ...) /home/runner/work/opencode/opencode/packages/tui/internal/tui/tui.go:408 +0x1ddc github.com/charmbracelet/bubbletea/v2.(*Program).eventLoop(0x14002082000, {0x102d042c0?, 0x14002080000?}, 0x1400041c380) /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(0x14002082000) /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:146 +0xb24
yindo closed this issue 2026-02-16 17:31:30 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Sep 1, 2025):

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

  • #1215: Both issues involve crashes in the same code path (Prompt.ToMessage and App.SendPrompt functions) when sending prompts, though with different specific runtime errors

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

@github-actions[bot] commented on GitHub (Sep 1, 2025): This issue might be a duplicate of existing issues. Please check: - #1215: Both issues involve crashes in the same code path (Prompt.ToMessage and App.SendPrompt functions) when sending prompts, though with different specific runtime errors Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Sep 1, 2025):

i will fix, thx for raising

@rekram1-node commented on GitHub (Sep 1, 2025): i will fix, thx for raising
Author
Owner

@JoshuaRileyDev commented on GitHub (Sep 1, 2025):

If it's any help, I just re-created it again:

Caught panic:

runtime error: slice bounds out of range [154:153]

Restoring terminal...

goroutine 1 [running]:
runtime/debug.Stack()
/opt/hostedtoolcache/go/1.24.6/x64/src/runtime/debug/stack.go:26 +0x64
github.com/charmbracelet/bubbletea/v2.(*Program).recoverFromPanic(0x1400073c000, {0x103493a40, 0x14000398720})
/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({0x103493a40?, 0x14000398720?})
/opt/hostedtoolcache/go/1.24.6/x64/src/runtime/panic.go:792 +0x124
github.com/sst/opencode/internal/app.Prompt.ToMessage({{0x140034f8701, 0x99}, {0x14000280008, 0x1, 0x1}}, {0x140036c85e0, 0x1e}, {0x140003d00b7, 0x1e})
/home/runner/work/opencode/opencode/packages/tui/internal/app/prompt.go:46 +0xa1c
github.com/sst/opencode/internal/app.(*App).SendPrompt(0x1400036a488, {0x1034f7838, 0x103ac6e60}, {{0x140034f8701, 0x99}, {0x14000280008, 0x1, 0x1}})
/home/runner/work/opencode/opencode/packages/tui/internal/app/app.go:780 +0x1a8
github.com/sst/opencode/internal/tui.Model.Update({{0x0, 0x0}, {0x0, 0x0}, 0x80, 0x2d, 0x1400036a488, {0x0, 0x0}, {0x1034f7df8, ...}, ...}, ...)
/home/runner/work/opencode/opencode/packages/tui/internal/tui/tui.go:408 +0x1ddc
github.com/charmbracelet/bubbletea/v2.(*Program).eventLoop(0x1400073c000, {0x1034f42c0?, 0x1400051c000?}, 0x140007160e0)
/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(0x1400073c000)
/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:146 +0xb24

Seems to be after a good few prompts.

Only just properly starting to use opencode coming from CC, really slick and fast! Love all the customisation and features on par with CC.

Also love how it can work with their max sub

@JoshuaRileyDev commented on GitHub (Sep 1, 2025): If it's any help, I just re-created it again: Caught panic: runtime error: slice bounds out of range [154:153] Restoring terminal... goroutine 1 [running]: runtime/debug.Stack() /opt/hostedtoolcache/go/1.24.6/x64/src/runtime/debug/stack.go:26 +0x64 github.com/charmbracelet/bubbletea/v2.(*Program).recoverFromPanic(0x1400073c000, {0x103493a40, 0x14000398720}) /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({0x103493a40?, 0x14000398720?}) /opt/hostedtoolcache/go/1.24.6/x64/src/runtime/panic.go:792 +0x124 github.com/sst/opencode/internal/app.Prompt.ToMessage({{0x140034f8701, 0x99}, {0x14000280008, 0x1, 0x1}}, {0x140036c85e0, 0x1e}, {0x140003d00b7, 0x1e}) /home/runner/work/opencode/opencode/packages/tui/internal/app/prompt.go:46 +0xa1c github.com/sst/opencode/internal/app.(*App).SendPrompt(0x1400036a488, {0x1034f7838, 0x103ac6e60}, {{0x140034f8701, 0x99}, {0x14000280008, 0x1, 0x1}}) /home/runner/work/opencode/opencode/packages/tui/internal/app/app.go:780 +0x1a8 github.com/sst/opencode/internal/tui.Model.Update({{0x0, 0x0}, {0x0, 0x0}, 0x80, 0x2d, 0x1400036a488, {0x0, 0x0}, {0x1034f7df8, ...}, ...}, ...) /home/runner/work/opencode/opencode/packages/tui/internal/tui/tui.go:408 +0x1ddc github.com/charmbracelet/bubbletea/v2.(*Program).eventLoop(0x1400073c000, {0x1034f42c0?, 0x1400051c000?}, 0x140007160e0) /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(0x1400073c000) /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:146 +0xb24 Seems to be after a good few prompts. Only just properly starting to use opencode coming from CC, really slick and fast! Love all the customisation and features on par with CC. Also love how it can work with their max sub
Author
Owner

@rekram1-node commented on GitHub (Sep 1, 2025):

happy to hear it :)

@rekram1-node commented on GitHub (Sep 1, 2025): happy to hear it :)
Author
Owner

@rekram1-node commented on GitHub (Sep 1, 2025):

would be curious to see the session that caused this, seems like the bug is elsewhere but I can add a bounds check to prevent panic

@rekram1-node commented on GitHub (Sep 1, 2025): would be curious to see the session that caused this, seems like the bug is elsewhere but I can add a bounds check to prevent panic
Author
Owner

@rekram1-node commented on GitHub (Sep 1, 2025):

Added fix for next release that will prevent panics

@rekram1-node commented on GitHub (Sep 1, 2025): Added fix for next release that will prevent panics
Author
Owner

@JoshuaRileyDev commented on GitHub (Sep 1, 2025):

I can send the sessions tomorrow if you can give me instructions on how to
retrieve the logs.

I know it was a little bit of text I sent as I ramble with WisprFlow.

It’s been hard trying to know exactly the steps I took to replicate it.

Best Regards,

Joshua Riley

On Mon, Sep 1, 2025 at 22:28 Aiden Cline @.***> wrote:

rekram1-node left a comment (sst/opencode#2353)
https://github.com/sst/opencode/issues/2353#issuecomment-3243277483

would be curious to see the session that caused this, seems like the bug
is elsewhere but I can add a bounds check to prevent panic


Reply to this email directly, view it on GitHub
https://github.com/sst/opencode/issues/2353#issuecomment-3243277483, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AOEMUTRFGZNRV24OP64H2EL3QS3ALAVCNFSM6AAAAACFKQCSVGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTENBTGI3TONBYGM
.
You are receiving this because you authored the thread.Message ID:
@.***>

@JoshuaRileyDev commented on GitHub (Sep 1, 2025): I can send the sessions tomorrow if you can give me instructions on how to retrieve the logs. I know it was a little bit of text I sent as I ramble with WisprFlow. It’s been hard trying to know exactly the steps I took to replicate it. Best Regards, Joshua Riley On Mon, Sep 1, 2025 at 22:28 Aiden Cline ***@***.***> wrote: > *rekram1-node* left a comment (sst/opencode#2353) > <https://github.com/sst/opencode/issues/2353#issuecomment-3243277483> > > would be curious to see the session that caused this, seems like the bug > is elsewhere but I can add a bounds check to prevent panic > > — > Reply to this email directly, view it on GitHub > <https://github.com/sst/opencode/issues/2353#issuecomment-3243277483>, or > unsubscribe > <https://github.com/notifications/unsubscribe-auth/AOEMUTRFGZNRV24OP64H2EL3QS3ALAVCNFSM6AAAAACFKQCSVGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTENBTGI3TONBYGM> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> >
Author
Owner

@rekram1-node commented on GitHub (Sep 1, 2025):

@JoshuaRileyDev if you could just open the session use the up arrow to navigate to previous prompts you have tried to send and then just paste the prompt that may help

or maybe try to do a share link of the session

idk if it will be in logs since the prompt crashed the service and it may be difficult to locate them unless it was the last opencode interaction you had

@rekram1-node commented on GitHub (Sep 1, 2025): @JoshuaRileyDev if you could just open the session use the up arrow to navigate to previous prompts you have tried to send and then just paste the prompt that may help or maybe try to do a share link of the session idk if it will be in logs since the prompt crashed the service and it may be difficult to locate them unless it was the last opencode interaction you had
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1552