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

index out of range [1] with length 1 #105

Closed
khangich opened this issue May 1, 2024 · 1 comment
Closed

index out of range [1] with length 1 #105

khangich opened this issue May 1, 2024 · 1 comment
Assignees

Comments

@khangich
Copy link

khangich commented May 1, 2024

I'm testing plandex and run into this issue.

prompt:

'build a new end points which do the follow ing

  • given a userid through get method
  • load all the questions they ever did and answer wrong for the last 7 days or top 10 questions. Whatever come first.
  • for each question, load one similar question from database. Try reuse already provided functions
  • after we have 10 questions. For each questionw we display the question a long with a textbox or selecttion box depend on the type of question
  • create a form so user can answer the questions
  • the form should send an post request
  • create a new endpioint to handle that post requests'

Stacktrace:

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

Restoring terminal...

goroutine 120 [running]:
runtime/debug.Stack()
/opt/homebrew/Cellar/go/1.22.2/libexec/src/runtime/debug/stack.go:24 +0x64
runtime/debug.PrintStack()
/opt/homebrew/Cellar/go/1.22.2/libexec/src/runtime/debug/stack.go:16 +0x1c
github.com/charmbracelet/bubbletea.(*Program).Run.func1()
/Users/khangpham/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:478 +0x88
panic({0x104fc9780?, 0x1400055aa38?})
/opt/homebrew/Cellar/go/1.22.2/libexec/src/runtime/panic.go:770 +0x124
plandex/stream_tui.streamUIModel.doRenderBuild({0x0, {{{0x14000980310, 0x1, 0x1}, {{...}, {...}}, 0x0}, {{0x14000980330, 0x1, 0x1}, ...}, ...}, ...}, ...)
/Users/khangpham/workspace/plandex/app/cli/stream_tui/view.go:150 +0xcac
plandex/stream_tui.streamUIModel.renderBuild(...)
/Users/khangpham/workspace/plandex/app/cli/stream_tui/view.go:60
plandex/stream_tui.(*streamUIModel).getViewportDimensions(0x14000780c08)
/Users/khangpham/workspace/plandex/app/cli/stream_tui/update.go:156 +0x114
plandex/stream_tui.(*streamUIModel).updateViewportDimensions(...)
/Users/khangpham/workspace/plandex/app/cli/stream_tui/update.go:143
plandex/stream_tui.(*streamUIModel).streamUpdate(0x14000780c08, 0x1400050cd10)
/Users/khangpham/workspace/plandex/app/cli/stream_tui/update.go:311 +0x3f4
plandex/stream_tui.streamUIModel.Update({0x0, {{{0x14000980310, 0x1, 0x1}, {{...}, {...}}, 0x0}, {{0x14000980330, 0x1, 0x1}, ...}, ...}, ...}, ...)
/Users/khangpham/workspace/plandex/app/cli/stream_tui/update.go:38 +0x4dc
github.com/charmbracelet/bubbletea.(*Program).eventLoop(0x140003e8340, {0x10500f340?, 0x140001e8008?}, 0x14000113800)
/Users/khangpham/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:411 +0x4d8
github.com/charmbracelet/bubbletea.(*Program).Run(0x140003e8340)
/Users/khangpham/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:543 +0x6c8
plandex/stream_tui.StartStreamUI({0x16ba4a9c2, 0x24a}, 0x0)
/Users/khangpham/workspace/plandex/app/cli/stream_tui/run.go:40 +0x258
plandex/plan_exec.TellPlan.func1.1()
/Users/khangpham/workspace/plandex/app/cli/plan_exec/tell.go:125 +0x38
created by plandex/plan_exec.TellPlan.func1 in goroutine 1
/Users/khangpham/workspace/plandex/app/cli/plan_exec/tell.go:124 +0x450
panic: interface conversion: tea.Model is nil, not streamtui.streamUIModel

goroutine 120 [running]:
plandex/stream_tui.StartStreamUI({0x16ba4a9c2, 0x24a}, 0x0)
/Users/khangpham/workspace/plandex/app/cli/stream_tui/run.go:52 +0x884
plandex/plan_exec.TellPlan.func1.1()
/Users/khangpham/workspace/plandex/app/cli/plan_exec/tell.go:125 +0x38
created by plandex/plan_exec.TellPlan.func1 in goroutine 1
/Users/khangpham/workspace/plandex/app/cli/plan_exec/tell.go:124 +0x450
➜ math-llm git:(main) ✗ pl t 'build a new end points which do the follow ing

  • given a userid through get method
  • load all the questions they ever did and answer wrong for the last 7 days or top 10 questions. Whatever come first.
  • for each question, load one similar question from database. Try reuse already provided functions
  • after we have 10 questions. For each questionw we display the question a long with a textbox or selecttion box depend on the type of question
  • create a form so user can answer the questions
  • the form should send an post request
  • create a new endpioint to handle that post requests'
    ✅ Context is up to date
    Caught panic:

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

Restoring terminal...

goroutine 117 [running]:
runtime/debug.Stack()
/opt/homebrew/Cellar/go/1.22.2/libexec/src/runtime/debug/stack.go:24 +0x64
runtime/debug.PrintStack()
/opt/homebrew/Cellar/go/1.22.2/libexec/src/runtime/debug/stack.go:16 +0x1c
github.com/charmbracelet/bubbletea.(*Program).Run.func1()
/Users/khangpham/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:478 +0x88
panic({0x105ab5780?, 0x14000024240?})
/opt/homebrew/Cellar/go/1.22.2/libexec/src/runtime/panic.go:770 +0x124
plandex/stream_tui.streamUIModel.doRenderBuild({0x0, {{{0x1400003d070, 0x1, 0x1}, {{...}, {...}}, 0x0}, {{0x1400003d090, 0x1, 0x1}, ...}, ...}, ...}, ...)
/Users/khangpham/workspace/plandex/app/cli/stream_tui/view.go:150 +0xcac
plandex/stream_tui.streamUIModel.renderBuild(...)
/Users/khangpham/workspace/plandex/app/cli/stream_tui/view.go:60
plandex/stream_tui.(*streamUIModel).getViewportDimensions(0x14000906608)
/Users/khangpham/workspace/plandex/app/cli/stream_tui/update.go:156 +0x114
plandex/stream_tui.(*streamUIModel).updateViewportDimensions(...)
/Users/khangpham/workspace/plandex/app/cli/stream_tui/update.go:143
plandex/stream_tui.(*streamUIModel).streamUpdate(0x14000906608, 0x140006f4d10)
/Users/khangpham/workspace/plandex/app/cli/stream_tui/update.go:311 +0x3f4
plandex/stream_tui.streamUIModel.Update({0x0, {{{0x1400003d070, 0x1, 0x1}, {{...}, {...}}, 0x0}, {{0x1400003d090, 0x1, 0x1}, ...}, ...}, ...}, ...)
/Users/khangpham/workspace/plandex/app/cli/stream_tui/update.go:38 +0x4dc
github.com/charmbracelet/bubbletea.(*Program).eventLoop(0x14000528270, {0x105afb340?, 0x1400052c008?}, 0x14000035980)
/Users/khangpham/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:411 +0x4d8
github.com/charmbracelet/bubbletea.(*Program).Run(0x14000528270)
/Users/khangpham/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:543 +0x6c8
plandex/stream_tui.StartStreamUI({0x16af5e9c2, 0x24a}, 0x0)
/Users/khangpham/workspace/plandex/app/cli/stream_tui/run.go:40 +0x258
plandex/plan_exec.TellPlan.func1.1()
/Users/khangpham/workspace/plandex/app/cli/plan_exec/tell.go:125 +0x38
created by plandex/plan_exec.TellPlan.func1 in goroutine 1
/Users/khangpham/workspace/plandex/app/cli/plan_exec/tell.go:124 +0x450
panic: interface conversion: tea.Model is nil, not streamtui.streamUIModel

goroutine 117 [running]:
plandex/stream_tui.StartStreamUI({0x16af5e9c2, 0x24a}, 0x0)
/Users/khangpham/workspace/plandex/app/cli/stream_tui/run.go:52 +0x884
plandex/plan_exec.TellPlan.func1.1()
/Users/khangpham/workspace/plandex/app/cli/plan_exec/tell.go:125 +0x38
created by plandex/plan_exec.TellPlan.func1 in goroutine 1
/Users/khangpham/workspace/plandex/app/cli/plan_exec/tell.go:124 +0x450

@danenania
Copy link
Contributor

Thanks for the details @khangich --investigating!

@danenania danenania self-assigned this May 6, 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