Closing a code fence containing a slash causes panic #464

Closed
opened 2026-02-16 17:26:58 -05:00 by yindo · 1 comment
Owner

Originally created by @cschmatzler on GitHub (Jul 3, 2025).

Originally assigned to: @adamdotdevin on GitHub.

There's a conflict somewhere between the file picker and code fences.
Reproduction: Open a new session, try to type /.

Results in

❯ opencode
Caught panic:

runtime error: invalid memory address or nil pointer dereference

Restoring terminal...

goroutine 75 [running]:
runtime/debug.Stack()
        /opt/hostedtoolcache/go/1.24.4/x64/src/runtime/debug/stack.go:26 +0x64
runtime/debug.PrintStack()
        /opt/hostedtoolcache/go/1.24.4/x64/src/runtime/debug/stack.go:18 +0x1c
github.com/charmbracelet/bubbletea/v2.(*Program).recoverFromPanic(0x14000254000, {0x1039e9900, 0x103fedd00})
        /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.3/tea.go:1134 +0xb0
github.com/charmbracelet/bubbletea/v2.(*Program).handleCommands.func1.1.1()
        /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.3/tea.go:482 +0x40
panic({0x1039e9900?, 0x103fedd00?})
        /opt/hostedtoolcache/go/1.24.4/x64/src/runtime/panic.go:792 +0x124
github.com/sst/opencode/internal/completions.(*filesAndFoldersContextGroup).GetChildEntries(0x14000676390, {0x140004807d9?, 0x1400058cf18?})
        /home/runner/work/opencode/opencode/packages/tui/internal/completions/files-folders.go:80 +0x20c
github.com/sst/opencode/internal/components/dialog.(*completionDialogComponent).Update.func1()
        /home/runner/work/opencode/opencode/packages/tui/internal/components/dialog/complete.go:135 +0x38
github.com/charmbracelet/bubbletea/v2.(*Program).handleCommands.func1.1()
        /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.3/tea.go:487 +0x64
created by github.com/charmbracelet/bubbletea/v2.(*Program).handleCommands.func1 in goroutine 13
        /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.3/tea.go:477 +0x10c

Version 0.1.181

https://github.com/user-attachments/assets/9136a5b7-5664-4d7d-9f1b-40cef6b25534

Originally created by @cschmatzler on GitHub (Jul 3, 2025). Originally assigned to: @adamdotdevin on GitHub. There's a conflict somewhere between the file picker and code fences. Reproduction: Open a new session, try to type `/`. Results in ``` ❯ opencode Caught panic: runtime error: invalid memory address or nil pointer dereference Restoring terminal... goroutine 75 [running]: runtime/debug.Stack() /opt/hostedtoolcache/go/1.24.4/x64/src/runtime/debug/stack.go:26 +0x64 runtime/debug.PrintStack() /opt/hostedtoolcache/go/1.24.4/x64/src/runtime/debug/stack.go:18 +0x1c github.com/charmbracelet/bubbletea/v2.(*Program).recoverFromPanic(0x14000254000, {0x1039e9900, 0x103fedd00}) /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.3/tea.go:1134 +0xb0 github.com/charmbracelet/bubbletea/v2.(*Program).handleCommands.func1.1.1() /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.3/tea.go:482 +0x40 panic({0x1039e9900?, 0x103fedd00?}) /opt/hostedtoolcache/go/1.24.4/x64/src/runtime/panic.go:792 +0x124 github.com/sst/opencode/internal/completions.(*filesAndFoldersContextGroup).GetChildEntries(0x14000676390, {0x140004807d9?, 0x1400058cf18?}) /home/runner/work/opencode/opencode/packages/tui/internal/completions/files-folders.go:80 +0x20c github.com/sst/opencode/internal/components/dialog.(*completionDialogComponent).Update.func1() /home/runner/work/opencode/opencode/packages/tui/internal/components/dialog/complete.go:135 +0x38 github.com/charmbracelet/bubbletea/v2.(*Program).handleCommands.func1.1() /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.3/tea.go:487 +0x64 created by github.com/charmbracelet/bubbletea/v2.(*Program).handleCommands.func1 in goroutine 13 /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.3/tea.go:477 +0x10c ``` Version 0.1.181 https://github.com/user-attachments/assets/9136a5b7-5664-4d7d-9f1b-40cef6b25534
yindo closed this issue 2026-02-16 17:26:58 -05:00
Author
Owner

@cschmatzler commented on GitHub (Jul 3, 2025):

confirmed fixed in .185

@cschmatzler commented on GitHub (Jul 3, 2025): confirmed fixed in .185
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#464