<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Adds precise coordinate-based scrolling via CDP gestures and updates
prompt templates to guide when to use coordinates. Also auto-sizes
screenshots for Claude and Gemini to improve coordinate scaling
accuracy.
- **New Features**
- Added ScrollAtCoordinateAction and ScrollAtCoordinateEvent using CDP
synthesizeScrollGesture.
- Scales coordinates and scroll deltas from LLM screenshot size to the
real viewport.
- Reworked scroll action: page = viewport height, removed index, memory
reports in px.
- Added Anthropic-specific system prompts and selection logic; prompts
now advise when to use coordinates.
- Auto-configured LLM screenshot sizes: Claude Sonnet 1400x850, Gemini
1024x720.
- **Refactors**
- Shortened click action description.
- History step label is now "step_{number}".
- Included new Anthropic prompt files in packaging.
<sup>Written for commit 79df8fc818.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Fixes newline handling in SendKeys so Enter works reliably in forms and
text areas. Also increases typing timeouts and removes artificial delays
for faster, more reliable input.
- **Bug Fixes**
- Map '\n' and '\r' to Enter by dispatching rawKeyDown, char, and keyUp
(VK 13), ensuring correct submissions and line breaks.
- **Refactors**
- Increase default timeouts for TypeTextEvent and SendKeysEvent from 15s
to 60s.
- Remove 18ms per-character delay in typing and send-keys loops.
<sup>Written for commit c4bb681058.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
Added output format to Code Agent docs. Useful for llm code generation.
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Documented CodeAgent output format and return values so users can read
run() results and execution history. Added a new page and updated
parameter docs with current defaults and compatibility notes.
- **New Features**
- New Output Format page covering NotebookSession and CodeCell fields,
helper methods, task completion flags, and examples.
- Parameters doc updated: required/optional flags, defaults
(max_steps=100, use_vision=True), file_system, aliases (controller,
browser_session), and a return value section.
- Added the new page to docs.json navigation.
<sup>Written for commit 0efd006527.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Introduce CodeAgentHistoryList to standardize CodeAgent history with a
clear, typed, eval-compatible API. Replaces ad-hoc mocks and exposes
history directly on NotebookSession.
- **New Features**
- Added CodeAgentHistoryList with AgentHistoryList-compatible methods
(final_result, is_done, errors, urls, screenshots, action_results,
model_actions, save_to_file).
- NotebookSession.history now returns CodeAgentHistoryList; session
stores _complete_history and _usage_summary.
- run() persists history and usage into the session for later access.
- **Refactors**
- Removed DictToObject/MockAgentHistoryList; service.history now returns
CodeAgentHistoryList.
- Centralized history logic in views.py and simplified service.py.
<sup>Written for commit 7851657ded.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Add an env var to control version checks at agent startup. Defaults to
true; set BROWSER_USE_VERSION_CHECK=false to skip the check and the
upgrade log.
- **New Features**
- Gate the latest-version lookup behind
CONFIG.BROWSER_USE_VERSION_CHECK.
- Document BROWSER_USE_VERSION_CHECK in .env.example with a short note.
<sup>Written for commit 9dc64f9b8b.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
Previously, when browser launch succeeded after retry using a temporary
directory, the code immediately deleted ALL temporary directories
including the one actively being used by the running browser process.
The fix preserves the currently used temporary directory until browser
cleanup
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Fixes a crash where a successful retry launch deleted the active
temporary user_data_dir, causing Chrome to write to a removed path. We
now keep the in-use temp profile until browser shutdown.
- **Bug Fixes**
- Only remove unused temporary directories after a successful launch.
- Track and preserve the active user_data_dir for cleanup on browser
kill.
<sup>Written for commit 4a7334ae77.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Preserves the active temporary `user_data_dir` after a successful
launch, cleaning only unused temp dirs and deferring the in-use dir
cleanup to browser kill.
>
> - **Watchdog
(`browser_use/browser/watchdogs/local_browser_watchdog.py`)**:
> - Only remove unused temporary `user_data_dir` directories after a
successful launch.
> - Identify the currently used directory and retain it in
`_temp_dirs_to_cleanup` (if temp) for cleanup on browser kill; otherwise
clear the list.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
4a7334ae77. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Switched the CDP URL from localhost to 127.0.0.1 in the local browser
watchdog to prevent IPv4/IPv6 connection issues, and fixed the
apply_to_job instructions (“Make sure to delegate…”).
<sup>Written for commit ca2bed58fe.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Switches CDP URL from localhost to 127.0.0.1 and cleans up example
instructions.
>
> - **Browser watchdog
(`browser_use/browser/watchdogs/local_browser_watchdog.py`)**:
> - Update CDP readiness check to use `http://127.0.0.1:{port}` instead
of `http://localhost:{port}` for both request and returned base
`cdp_url`.
> - **Examples (`examples/use-cases/apply_to_job.py`)**:
> - Minor instruction copy edit: fix capitalization/grammar in the
step-by-step plan note.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
ca2bed58fe. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Also dont change focus outside of get_or_create_cdp_session
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Restricts agent focus to page/tab targets via the session manager to
avoid iframes/workers. Screenshot capture validates the focused target
and falls back to a page target without changing focus; adds helpers to
inspect focus and page targets.
- **Bug Fixes**
- Gate focus updates to valid page/tab targets in SwitchTabEvent and
AgentFocusChangedEvent.
- Use get_or_create_cdp_session(..., focus=True) for focus changes;
remove direct agent_focus_target_id writes.
- ScreenshotWatchdog: capture only from page/tab targets; fallback to a
page target if focus is invalid; do not change focus (focus=False).
- **New Features**
- get_focused_target(): returns the currently focused target.
- get_page_targets(): returns all page/tab targets, excluding
iframes/workers.
<sup>Written for commit 7e98622594.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
tested locally and worked
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Ensures newly focused tabs in headless mode apply the configured
viewport (width, height, device scale factor) so window size is
respected. Fixes inconsistent rendering when switching tabs.
- **Bug Fixes**
- On AgentFocusChangedEvent, call _cdp_set_viewport for the focused tab
via its target_id, with error handling and debug logs.
<!-- End of auto-generated description by cubic. -->
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Ensure newly focused tabs apply the configured viewport (width,
height, device scale factor) so window size is respected.
>
> - **Browser session (CDP)**:
> - On `AgentFocusChangedEvent`, set viewport on the focused tab using
`_cdp_set_viewport` with `event.target_id`.
> - Includes debug logging and error handling for viewport application
in `browser_use/browser/session.py`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
89990d360d. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Pass authentication headers to CDPClient and the /json/version fetch so
remote browser connections succeed with services that require auth. Adds
tests to verify headers flow through connect() for both ws and http
paths.
- **Bug Fixes**
- Use BrowserProfile.headers as additional_headers when creating
CDPClient.
- Include headers in httpx GET to /json/version when resolving the
WebSocket URL.
<sup>Written for commit 885ec7cc6f.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Improve demo mode with a new in-browser panel and persistent logs, plus
a display option for full panel or a minimal “last action + memory”
overlay. Also removes step-start and completion-summary demo logs to
keep output clean.
- **New Features**
- Added demo panel script generator with two modes: full side panel and
bottom-right “last action + memory” view.
- New profile setting: demo_mode_display = 'full' | 'last' (default
'last').
- Demo overlay now registers on new pages/tabs and updates on
navigation; logs and final result persist across reloads.
<sup>Written for commit c951b94193.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
### Problem
The `event_timeout` fields on all event classes were evaluated at
**module import time**, not at instance creation time. This meant that
environment variables like `TIMEOUT_TypeTextEvent` had to be set
**before** importing `browser_use`, making dynamic runtime configuration
impossible.
```python
# This didn't work:
import os
from browser_use.browser.events import TypeTextEvent
os.environ["TIMEOUT_TypeTextEvent"] = "60" # Too late - already evaluated to 15.0
event = TypeTextEvent(...)
print(event.event_timeout) # 15.0 ❌
```
### Solution
Changed all `event_timeout` field defaults from:
```python
event_timeout: float | None = _get_timeout('TIMEOUT_X', 15.0)
```
To:
```python
event_timeout: float | None = Field(default_factory=lambda: _get_timeout('TIMEOUT_X', 15.0))
```
Using `default_factory` defers the
[_get_timeout()](cci:1://file:///Users/tomergal/CascadeProjects/browser-use/browser_use/browser/events.py:15:0-42:15)
call until each event instance is created, allowing users to set timeout
environment variables at any point before creating events.
### After this fix
```python
import os
from browser_use.browser.events import TypeTextEvent
os.environ["TIMEOUT_TypeTextEvent"] = "60"
event = TypeTextEvent(...)
print(event.event_timeout) # 60.0 ✅
```
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Make event timeouts read environment variables at runtime by deferring
evaluation to event instantiation. This enables dynamic configuration
(e.g., setting TIMEOUT_* after import) to take effect when creating
events.
- **Bug Fixes**
- Switched all event_timeout fields to use Field(default_factory=...) so
_get_timeout runs per instance.
- TIMEOUT_* env vars are now read when an event is created, not at
module import time.
- Defaults remain unchanged if no env vars are set.
<sup>Written for commit 00462f9282.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Fixes enum serialization in structured outputs and preserves valid title
fields in JSON Schemas. This stabilizes agent action/result dumps and
Gemini function schema generation.
- **Bug Fixes**
- Serialize actions, results, and done payloads with mode='json' to
correctly handle enums (including nested values).
- In Gemini schema cleaning, only remove metadata-level title; keep
property title and allow it in required. Pass parent context to nested
items.
- Recursively process type values in schema optimization to resolve refs
nested under type.
- Keep Gemini schemas valid by inserting a placeholder when object
properties would be empty.
<sup>Written for commit 1c9a87b98f.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->