### Problem:
AttributeError: 'NoneType' object has no attribute
'get_target_id_from_session_id' occurred when the network response
handler ran after browser shutdown or before connection, when
session_manager was None.
### Root Cause:
The global Network.responseReceived callback can fire after
session_manager is cleared during _disconnect_from_browser(), causing a
race condition.
### Solution:
Added a None check before accessing
session_manager.get_target_id_from_session_id() in on_response_received,
returning early if session_manager is None. Added a warning log for
visibility.
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Handled None session_manager in DownloadsWatchdog to avoid crashes when
Network.responseReceived fires during browser shutdown or before
connection. We now skip network monitoring and log a warning if
session_manager is missing.
<sup>Written for commit a3e1ed7274.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
- Replace ListPrompt with FuzzyPrompt for real-time search
- Add responsive layout based on terminal width
- Display author names for non-default templates
- Organize templates: defaults, featured, others
- Sort by last modified date within sections
- Remove default pre-selection for cleaner UX
Enhances template discovery with intuitive search and better
organization.
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds fuzzy search and a responsive TUI for template selection to make
finding templates faster and clearer. Improves discovery with organized
sections and visible metadata.
- **New Features**
- Real-time fuzzy search replaces the list prompt.
- Responsive choice formatting based on terminal width.
- Shows [FEATURED] and author names (non-default templates).
- Organized into defaults, featured, and others.
- Sorted by last_modified_date within each section (newest first).
- Removed default pre-selection.
<sup>Written for commit 3505fe5d5f.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Introduces a fuzzy-search TUI with responsive choice formatting,
organized sections, and recency sorting for template selection in
`browser_use/init_cmd.py`.
>
> - **CLI (`browser_use/init_cmd.py`)**:
> - Replace list prompt with fuzzy-search prompt for interactive
template selection.
> - Add responsive choice formatting based on terminal width; include
`[FEATURED]` and author (non-default templates).
> - Organize templates into defaults, featured, and others; sort each by
`author.last_modified_date` (newest first).
> - Remove default pre-selection and numeric keybindings; enable
scrollable list (`max_height='70%'`).
> - Introduce `_get_terminal_width` and `_format_choice` helpers.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
3505fe5d5f. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Added detailed debug and warning logs to DownloadsWatchdog’s
BrowserStateRequestEvent flow to improve traceability and
troubleshooting without changing behavior.
- **New Features**
- Log start and successful completion of BrowserStateRequestEvent
handling.
- Include event_id and target_id (last 4 chars) and truncate URLs to 80
chars in logs.
- Warn and skip when there’s no valid focus or no URL.
<sup>Written for commit 1f758178da.
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
Improved navigation reliability and speed with lifecycle-driven waits
and smarter tab handling. Centralized target/session state in
SessionManager to remove polling and prevent race conditions.
- **New Features**
- Added _navigate_and_wait that waits for networkIdle, falling back to
load (2–4s timeout) with loaderId matching.
- SessionManager now enables Page lifecycle + Network once per session,
discovers targets, updates title/URL via targetInfoChanged, initializes
existing tabs, and stores lifecycle events per session so monitoring is
ready before navigation.
- **Refactors**
- Reuse about:blank tabs using cached target data to avoid extra CDP
calls; fall back to current tab on failures.
- Centralized targets/sessions in SessionManager (Target entity) with
cached tabs/URLs; added get_all_page_sessions and made session retrieval
sync; removed polling; iframe targets included; lazy frame fetch for DOM
builds.
- Only switch tabs when needed; safer target_id handling; removed fixed
post-navigate sleep and tab responsiveness checks; still emit
NavigationCompleteEvent on errors.
- Standardized agent focus to agent_focus_target_id with helpers to get
focused session/target; updated watchdogs/CLI and added safer focus
change handling with an about:blank fallback; added
create_task_with_error_handling for background tasks to avoid unhandled
exceptions.
- Updated cdp-use to 1.4.4 and increased max WebSocket frame size to
200MB to better handle large DOMs.
<sup>Written for commit 315995c092.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
- Introduced a variable to hold exceptions for re-raising outside the try-except block, ensuring proper propagation to the event loop.
- Updated comments for clarity on the exception handling process in background tasks.
- Replace ListPrompt with FuzzyPrompt for real-time search
- Add responsive layout based on terminal width
- Display author names for non-default templates
- Organize templates: defaults, featured, others
- Sort by last modified date within sections
- Remove default pre-selection for cleaner UX
Enhances template discovery with intuitive search and better organization.
- Updated the logging behavior for exceptions in background tasks to log at warning level and re-raise exceptions for better propagation to the event loop's exception handler.
- Enhanced clarity in comments regarding exception retrieval and handling.
- Updated the method of obtaining CDP sessions to utilize the public API, enhancing error handling during session retrieval.
- Added exception handling to ensure graceful failure when sessions cannot be created or retrieved, improving robustness in both the main functionality and tests.
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Add debug logging of the raw version info response in session.connect
and a clearer assert message when the CDP URL is missing. This helps
diagnose failures when connecting to existing Chromium browsers via CDP.
<sup>Written for commit a2e81f17d7.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
- Changed the type of the all_frames parameter to allow for None, enabling lazy fetching of cross-origin iframes only when necessary.
- Updated comments to clarify the behavior of all_frames during DOM tree construction.
- Adjusted the structure of event handling for 'networkIdle' and 'load' events to improve readability and maintainability.
- Ensured that logging for page readiness is consistently executed within the event handling logic.
- Updated the `create_task_with_error_handling` calls in `DOMWatchdog` to include the `suppress_exceptions` parameter, improving error management during DOM tree building and screenshot capturing.
- This change allows for better handling of exceptions without interrupting the flow of task execution.
- Improved the `create_task_with_error_handling` function to allow for better exception logging and retrieval based on the `suppress_exceptions` parameter.
- Updated `SessionManager` to implement event-driven recovery for stale agent focus, replacing polling with efficient event handling.
- Refactored session retrieval methods to ensure focus validation and recovery are handled automatically.
- Enhanced logging for recovery processes and session management to provide clearer insights into state changes and errors.
- Adjusted various watchdogs to utilize the new session management methods, ensuring they correctly handle focus validation and session retrieval.
- Updated cdp-use dependency to version 1.4.4 for improved functionality.
- Increased max WebSocket frame size to 200MB in BrowserSession to accommodate large DOMs.
## Description
Adds AWS Bedrock configuration examples to `.env.example` to help new
users configure AWS Bedrock models.
## Motivation
The codebase currently supports AWS Bedrock through `ChatAWSBedrock` and
`ChatAnthropicBedrock` classes, but the `.env.example` file doesn't
include any AWS Bedrock configuration examples. This makes it difficult
for new users to know which environment variables are needed and how to
configure them.
## Changes
- Added AWS Bedrock configuration section with all required environment
variables:
- `AWS_ACCESS_KEY_ID`
- `AWS_SECRET_ACCESS_KEY`
- `AWS_SESSION_TOKEN` (marked as optional for temporary credentials)
- `AWS_REGION` (with note about `AWS_DEFAULT_REGION` alternative)
- Included helpful comments about:
- Installation requirements (`pip install browser-use[aws]`)
- AWS Bedrock access and permissions requirements
- When session token is needed
## Testing
- Verified the environment variables match those used in
`browser_use/llm/aws/chat_bedrock.py` and
`browser_use/llm/aws/chat_anthropic.py`
- Confirmed consistency with the example in `examples/models/aws.py`
## Related Files
- Implementation: `browser_use/llm/aws/chat_bedrock.py`
- Implementation: `browser_use/llm/aws/chat_anthropic.py`
- Example usage: `examples/models/aws.py`
## Checklist
- [x] Documentation updated
- [x] Changes are consistent with existing code
- [x] Follows project's formatting conventions
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Add AWS Bedrock configuration examples to .env.example to simplify setup
for Bedrock models. Includes AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY,
optional AWS_SESSION_TOKEN, AWS_REGION, plus notes on installing
browser-use[aws] and required Bedrock access/permissions.
<sup>Written for commit d9ff851279.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
- Eliminated the caching of target types in SessionManager, simplifying the management of target information.
- Updated various components to directly access target types from the Target objects, enhancing clarity and reducing redundancy.
- Adjusted related methods in BrowserSession, CrashWatchdog, and DomService to reflect the changes in target type retrieval.
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Updated the README to make the package download badge clickable, linking
to https://cloud.browser-use.com for easier navigation to Browser-Use
Cloud.
<sup>Written for commit b440cfb13e.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
## Summary by cubic
Adds optional ground truth to the judge to validate agent results
against known answers or required criteria. When provided, the judge
prioritizes it and returns false if the ground truth isn’t met.
- **New Features**
- Judge now accepts a ground_truth string and embeds it into system and
user prompts.
- Ground truth is treated as highest-priority validation.
- AgentSettings includes ground_truth; service passes it to judge.
- Example updated to demonstrate validation when the provided
ground_truth is wrong.
- **Migration**
- No breaking changes.
- To use: set ground_truth on Agent or in settings with the expected
answer or criteria.