Skip to content

Conversation

@kalil0321
Copy link
Contributor

@kalil0321 kalil0321 commented Nov 8, 2025


Summary by cubic

Adds a demo mode that injects a side panel into the browser to stream live agent logs and state. This lets you follow actions, thoughts, errors, and results without checking the console.

  • New Features

    • New demo_mode flag in Agent, CodeAgent, and BrowserProfile (default off).
    • In-browser panel injected via CDP with a DemoMode helper; BrowserSession exposes send_demo_mode_log(); panel renders text safely (no HTML).
    • Agent/CodeAgent now log step start/completion, actions (with params), LLM responses/thinking, evaluations, memory, partial results, errors, and final result to the panel; CodeAgent adds a sample output preview cell.
    • Short delay before auto-close to allow reading final messages.
    • DOM serializer passes session_id and filters out overlay elements using a session-specific data-browser-use-exclude-<session_id> attribute.
    • Example added: examples/demo_mode_example.py.
  • Migration

    • Enable with demo_mode=True on Agent/CodeAgent or in BrowserProfile.
    • Run with headless=False to see the panel (warning logged if headless=True).
    • No changes needed if you don’t use demo mode.

Written for commit c29e358. Summary will update automatically on new commits.


Note

Adds an optional demo mode that injects a browser side panel to stream live agent/code-agent logs, with session-scoped DOM exclusion and logging hooks across the stack.

  • Demo Mode (browser UI):
    • New DemoMode helper and injected JS panel streaming logs via window events; persisted per-page, toggleable floating button.
    • BrowserProfile.demo_mode flag (default false); BrowserSession.demo_mode lazy helper; send_demo_mode_log() API; auto-injected on start; warns if headless.
  • Agents Integration:
    • Agent and CodeAgent accept demo_mode; broadcast step start/completion, actions (and params), LLM responses/thinking/evaluations, memory/next goal, errors, and final/partial results to the panel.
    • Small UX: short delay before auto-close to read final messages; CodeAgent adds a sample output preview cell.
  • DOM/Serialization:
    • Pass session_id to DOMTreeSerializer; filter elements marked with session-specific data-browser-use-exclude-<session_id> (fallback to legacy attr); propagation through DomService, Page.get_element_by_prompt.
  • Session/Startup:
    • Inject demo overlay on connect/start (local or cloud); reset on session reset.
  • Example:
    • examples/demo_mode_example.py showcasing Agent(..., demo_mode=True).

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

@kalil0321 kalil0321 marked this pull request as ready for review November 8, 2025 20:42
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 9 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="browser_use/browser/demo_mode.py">

<violation number="1" location="browser_use/browser/demo_mode.py:690">
Rendering the log message with innerHTML means any markup in the payload will run in the page context. Please use a safe text assignment or sanitize the payload before inserting it.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

@kalil0321
Copy link
Contributor Author

When filming demos, having to screen between browser and terminal requires more work. Having the logs directly in the panel can be a good thing.
Screenshot 2025-11-13 at 15 28 28

@MagMueller
Copy link
Collaborator

super cool!

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@MagMueller
Copy link
Collaborator

Happy to merge this

@MagMueller
Copy link
Collaborator

is there a way to make it consistent across navigation?

@MagMueller
Copy link
Collaborator

image And I think you can remove these 2 logs so that you only see memory + action

@MagMueller MagMueller merged commit 5bc077c into browser-use:main Nov 14, 2025
44 checks passed
@MagMueller
Copy link
Collaborator

maybe you could even find a way how we could make this so nice that people want to have this as default

@MagMueller
Copy link
Collaborator

maybe similar to the gif version

@MagMueller
Copy link
Collaborator

or e.g. we just show the action as a small overlay in the lower right corner

@kalil0321
Copy link
Contributor Author

yes, i will try to work on it

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.

2 participants