Skip to content

Conversation

@tnsardesai
Copy link
Contributor

@tnsardesai tnsardesai commented Dec 10, 2025

kernel browsers list panics when there are no browsers to list! Fixed and added a unit test for it 😄

I also didn't like that prod release is 4 commands so I vibed a script to do it

Previously

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1025be884]

goroutine 1 [running]:
github.com/onkernel/cli/cmd.BrowsersCmd.List({{0x1029b10c8, 0x140000d2300}, {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, ...}, ...)
	/Users/tanmaysardesai/github.com/onkernel/cli/cmd/browsers.go:222 +0x164
github.com/onkernel/cli/cmd.runBrowsersList(0x102e4a560, {0x10263262a?, 0x4?, 0x102632536?})
	/Users/tanmaysardesai/github.com/onkernel/cli/cmd/browsers.go:2128 +0x2ec
github.com/spf13/cobra.(*Command).execute(0x102e4a560, {0x102e80cc0, 0x0, 0x0})
	/Users/tanmaysardesai/go/pkg/mod/github.com/spf13/[email protected]/command.go:1015 +0x7d4
github.com/spf13/cobra.(*Command).ExecuteC(0x102e4ece0)
	/Users/tanmaysardesai/go/pkg/mod/github.com/spf13/[email protected]/command.go:1148 +0x350
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/tanmaysardesai/go/pkg/mod/github.com/spf13/[email protected]/command.go:1071
github.com/spf13/cobra.(*Command).ExecuteContext(...)
	/Users/tanmaysardesai/go/pkg/mod/github.com/spf13/[email protected]/command.go:1064
github.com/charmbracelet/fang.Execute({0x1029ae0f8, 0x102e80cc0}, 0x102e4ece0, {0x14000223e98, 0x2, 0x2?})
	/Users/tanmaysardesai/go/pkg/mod/github.com/charmbracelet/[email protected]/fang.go:151 +0x320
github.com/onkernel/cli/cmd.Execute({{0x10285b4f8, 0x6}, {0x10285bce0, 0x28}, {0x10285bb50, 0x14}, {0x10285ba98, 0x8}})
	/Users/tanmaysardesai/github.com/onkernel/cli/cmd/root.go:164 +0x2e8
main.main()
	/Users/tanmaysardesai/github.com/onkernel/cli/cmd/kernel/main.go:17 +0x78

now

 INFO  No running browsers found

Note

Prevents a panic in kernel browsers list when the API returns no page, adds a unit test, and introduces a scripts/release.sh with updated release docs.

  • CLI (browsers list)
    • Safely handle nil page from SDK in cmd/browsers.go and treat as empty results.
    • JSON output now prints [] when no items (len(browsers)==0).
    • Shows "No running browsers found" when empty instead of panicking.
  • Tests
    • Add TestBrowsersList_PrintsEmptyMessagePageIsNil in cmd/browsers_test.go.
  • Release
    • Add scripts/release.sh to tag, push, and run make release with basic version validation.
    • Update DEVELOPMENT.md to use git describe --abbrev=0 and ./scripts/release.sh <version> [description] for releases.

Written by Cursor Bugbot for commit fe327db. This will update automatically on new commits. Configure here.

Copy link
Contributor

@Sayan- Sayan- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great spot!

@tnsardesai tnsardesai requested a review from Sayan- December 10, 2025 19:38
@tnsardesai tnsardesai merged commit bc865df into main Dec 10, 2025
2 checks passed
@tnsardesai tnsardesai deleted the fix-nil-pages-panic branch December 10, 2025 19:52
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

Successfully merging this pull request may close these issues.

3 participants