Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime error: index out of range [1] with length 1 #84

Closed
notatestuser opened this issue Apr 12, 2024 · 2 comments
Closed

runtime error: index out of range [1] with length 1 #84

notatestuser opened this issue Apr 12, 2024 · 2 comments

Comments

@notatestuser
Copy link

notatestuser commented Apr 12, 2024

Caught this one just now after a "tell" to plandex and during its thinking.

Restoring terminal...

goroutine 88 [running]:
runtime/debug.Stack()
        /usr/local/go/src/runtime/debug/stack.go:24 +0x64
runtime/debug.PrintStack()
        /usr/local/go/src/runtime/debug/stack.go:16 +0x1c
github.com/charmbracelet/bubbletea.(*Program).Run.func1()
        /Users/ds/go/pkg/mod/github.com/charmbracelet/bubbletea@v0.25.0/tea.go:478 +0x88
panic({0x101978bc0?, 0x14000024168?})
        /usr/local/go/src/runtime/panic.go:920 +0x26c
plandex/stream_tui.streamUIModel.doRenderBuild({0x0, {{{0x140001e8a30, 0x1, 0x1}, {{...}, {...}}, 0x0}, {{0x140001e8a50, 0x1, 0x1}, ...}, ...}, ...}, ...)
        /Users/ds/projects/plandex/app/cli/stream_tui/view.go:142 +0xbb0
plandex/stream_tui.streamUIModel.renderBuild(...)
        /Users/ds/projects/plandex/app/cli/stream_tui/view.go:60
plandex/stream_tui.(*streamUIModel).getViewportDimensions(0x1400073ec00)
        /Users/ds/projects/plandex/app/cli/stream_tui/update.go:156 +0x114
plandex/stream_tui.(*streamUIModel).updateViewportDimensions(...)
        /Users/ds/projects/plandex/app/cli/stream_tui/update.go:143
plandex/stream_tui.(*streamUIModel).streamUpdate(0x1400073ec00, 0x140005b5b80)
        /Users/ds/projects/plandex/app/cli/stream_tui/update.go:311 +0x3f4
plandex/stream_tui.streamUIModel.Update({0x0, {{{0x140001e8a30, 0x1, 0x1}, {{...}, {...}}, 0x0}, {{0x140001e8a50, 0x1, 0x1}, ...}, ...}, ...}, ...)
        /Users/ds/projects/plandex/app/cli/stream_tui/update.go:38 +0x534
github.com/charmbracelet/bubbletea.(*Program).eventLoop(0x140003176c0, {0x1019bc2d0?, 0x14000516000?}, 0x1019bb408?)
        /Users/ds/go/pkg/mod/github.com/charmbracelet/bubbletea@v0.25.0/tea.go:411 +0x6bc
github.com/charmbracelet/bubbletea.(*Program).Run(0x140003176c0)
        /Users/ds/go/pkg/mod/github.com/charmbracelet/bubbletea@v0.25.0/tea.go:543 +0x6d8
plandex/stream_tui.StartStreamUI({0x16f0a6e02, 0x702}, 0x0?)
        /Users/ds/projects/plandex/app/cli/stream_tui/run.go:40 +0x240
plandex/plan_exec.TellPlan.func1.1()
        /Users/ds/projects/plandex/app/cli/plan_exec/tell.go:111 +0x38
created by plandex/plan_exec.TellPlan.func1 in goroutine 1
        /Users/ds/projects/plandex/app/cli/plan_exec/tell.go:110 +0x490
panic: interface conversion: tea.Model is nil, not streamtui.streamUIModel

goroutine 88 [running]:
plandex/stream_tui.StartStreamUI({0x16f0a6e02, 0x702}, 0x0?)
        /Users/ds/projects/plandex/app/cli/stream_tui/run.go:52 +0x824
plandex/plan_exec.TellPlan.func1.1()
        /Users/ds/projects/plandex/app/cli/plan_exec/tell.go:111 +0x38
created by plandex/plan_exec.TellPlan.func1 in goroutine 1
        /Users/ds/projects/plandex/app/cli/plan_exec/tell.go:110 +0x490
@danenania
Copy link
Contributor

Thanks for reporting @notatestuser. Is this happening predictably or was it a one-off? Looks like an additional nil check is needed.

@notatestuser
Copy link
Author

Thanks for reporting @notatestuser. Is this happening predictably or was it a one-off? Looks like an additional nil check is needed.

It was a one-off. I'll let you know here if I see it again!

danenania added a commit that referenced this issue Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants