Skip to content

Conversation

@masnwilliams
Copy link
Contributor

@masnwilliams masnwilliams commented Dec 5, 2025

Note

Adds a browsers get command for detailed session info and switches view/delete to use direct Get-based lookups with pagination helpers.

  • CLI:
    • New: browsers get <id> to display detailed browser session info (table or --output json).
    • View: now uses direct Get and prints live view URL to stdout; warns when headless or URL missing.
    • Registers get command and --output flag.
  • Core/Refactor:
    • Extend BrowsersService with Get.
    • Extract buildBrowserTableData for shared table rendering.
    • Delete: reuse resolveBrowserByIdentifier; add full pagination via listAllBrowsers and safeGetNextPage.
  • Tests:
    • Add/adjust tests for get, view (headless/missing/err), and error paths.
    • Update fakes to support Get and new behaviors.

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

@mesa-dot-dev
Copy link

mesa-dot-dev bot commented Dec 5, 2025

You do not have enough credits to review this pull request. Please purchase more credits to continue.

@mesa-dot-dev
Copy link

mesa-dot-dev bot commented Dec 5, 2025

Mesa Description

This PR refactors the browser management commands to improve code reusability and enhance pagination. It centralizes browser lookup logic into a new resolveBrowserByIdentifier function, reducing duplication in Delete and View commands. Additionally, new helper functions, listAllBrowsers and safeGetNextPage, have been introduced to ensure robust pagination and complete fetching of browser items across multiple pages.

Description generated by Mesa. Update settings

@masnwilliams masnwilliams requested a review from Sayan- December 5, 2025 22:59
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.

overall lgtm! have some sequencing q's I'll ping you about internally!

@masnwilliams masnwilliams merged commit 502c042 into main Dec 8, 2025
2 checks passed
@masnwilliams masnwilliams deleted the mason/browser-pagination-fix branch December 8, 2025 22:29
if page == nil || page.Items == nil || len(page.Items) == 0 {
pterm.Error.Println("No browsers found")
if browser == nil {
pterm.Error.Printf("Browser '%s' not found\n", in.Identifier)
Copy link

Choose a reason for hiding this comment

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

Bug: View function lost persistence ID lookup compatibility

The View function previously supported looking up browsers by either session ID or persistence ID (by iterating through list results). The refactored code now calls b.browsers.Get() directly with the identifier, which likely only accepts session IDs. This breaks backward compatibility for users who pass a persistent ID to kernel browsers view <persistence-id>. The Delete function correctly uses resolveBrowserByIdentifier which explicitly supports both identifier types for backward compatibility, but View and the new Get function bypass this helper.

Additional Locations (1)

Fix in Cursor Fix in Web

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