Skip to content

Conversation

@masnwilliams
Copy link
Contributor

@masnwilliams masnwilliams commented Nov 30, 2025

Note

Removes browser persistence, switches cleanup to delete-by-id, and introduces a long-running test browser action with timeout in both Python and TypeScript samples.

  • Python templates:
    • Advanced sample: Remove persistence from client.browsers.create(...) in templates/python/advanced-sample/main.py.
    • Sample app:
      • Switch cleanup from await browser.close() to client.browsers.delete_by_id(kernel_browser.session_id) in get-page-title.
      • Replace persisted browser action with create-browser-for-testing (rename types and action), use stealth=True and timeout_seconds=3600 (no persistence), update docs link.
  • TypeScript templates:
    • Advanced sample: Remove persistence from kernel.browsers.create(...) in templates/typescript/advanced-sample/index.ts.
    • Sample app:
      • Switch cleanup from await browser.close() to await kernel.browsers.deleteByID(kernelBrowser.session_id) in get-page-title.
      • Replace persisted browser action with create-browser-for-testing (rename interface and action), add stealth: true and timeout_seconds: 3600 (no persistence), update docs link.

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

@mesa-dot-dev
Copy link

mesa-dot-dev bot commented Nov 30, 2025

Mesa Description

This PR refactors the browser creation process by updating the parameters used during instantiation. The changes likely involve simplifying the configuration of new browser instances, potentially by removing or modifying parameters related to persistence, as suggested by the branch name mason/persistence-removal. This aims to streamline browser setup and improve code clarity.

Description generated by Mesa. Update settings

Copy link

@mesa-dot-dev mesa-dot-dev bot left a comment

Choose a reason for hiding this comment

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

Performed full review of 8d6b8ce...382e043

Analysis

  1. Breaking API Change: Removal of the persistence parameter without visible deprecation warnings or migration guide will break existing code using this feature.

  2. Inconsistent Type Definitions: TypeScript makes browser_live_view_url optional while Python keeps it required, creating an inconsistency between language implementations.

  3. Potential Functional Regression: The shift from persistence IDs to timeout-based management eliminates the ability to reuse browser state across invocations, which may impact use cases like captcha-solving that rely on persistent state.

  4. Documentation Alignment: While documentation URLs are updated, there appears to be insufficient guidance for users on how to adapt to the new browser lifecycle management approach.

Tip

Help

Slash Commands:

  • /review - Request a full code review
  • /review latest - Review only changes since the last review
  • /describe - Generate PR description. This will update the PR body or issue comment depending on your configuration
  • /help - Get help with Mesa commands and configuration options

4 files reviewed | 0 comments | Edit Agent SettingsRead Docs

Copy link
Contributor

@dprevoznik dprevoznik left a comment

Choose a reason for hiding this comment

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

Requested two quick changes (sorta unrelated, but noticed them). Otherwise looks good

const title = await page.title();
return { title };
} finally {
await browser.close();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we replace this line with:
await kernel.browsers.deleteByID(kernelBrowser.session_id);


return {"title": title}
finally:
await browser.close()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we replace this line with:

kernel.browsers.delete_by_id(kernel_browser.session_id)

return {"title": title}
finally:
await browser.close()
client.browsers.delete_by_id(kernel_browser.session_id)
Copy link

Choose a reason for hiding this comment

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

Bug: Missing await on async browser deletion call

The client.browsers.delete_by_id() call is missing await in this async function. The TypeScript equivalent properly uses await kernel.browsers.deleteByID(...), indicating this is an async operation. Without await, the browser deletion may not complete before the function returns, errors will be silently lost, and browser sessions may not be properly cleaned up.

Fix in Cursor Fix in Web

Copy link
Contributor

@dprevoznik dprevoznik left a comment

Choose a reason for hiding this comment

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

LGTM

@masnwilliams masnwilliams merged commit d064395 into main Dec 1, 2025
7 checks passed
@masnwilliams masnwilliams deleted the mason/persistence-removal branch December 1, 2025 20:01
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