AgentFixboard

record_har_path finishes the task and writes no HAR file

With record_har_path set, the task finishes and the caller's check prints ✗ HAR file was not created.

From GitHub

browser-use/browser-use

Difficulty
Moderate
Time
~15 min
Steps
3
Fixed in
0.11.9
Last checked

Verified fix: PR #3543 merged on . Fixed in 0.11.9 (first published release whose tag contains the merge commit). Last checked .

Symptom

With record_har_path set, the task finishes and the caller's check prints ✗ HAR file was not created.

Evidence what you'll see

  • The report builds Browser(headless=False, window_size={'width': 1000, 'height': 700}, record_har_path=str(har_file), record_har_mode="full", keep_alive=False) on browser-use 0.7.6.
  • The log shows go_to_url to https://example.com and Task completed successfully. The path har_test_output/agent_test_session.har is missing afterward.
  • The report says this may come from the shift away from Playwright. A comment says it seems not implemented in the new browser-use, that 0.6.0 still wrote the file, and another comment reports the same gap on 0.77/0.76.

Why it happens

record_har_path was still accepted on the browser profile, but nothing subscribed to network events or wrote the file when the session ended. Pull request #3543 adds HarRecordingWatchdog. It attaches only when browser_profile.record_har_path is set, listens for BrowserConnectedEvent and BrowserStopEvent, records HTTPS requests, and writes a HAR 1.2 file when the browser stops.

Affected versions

browser-use 0.7.6 on macOS and Linux, as the report states. A comment reports the same missing file on 0.77/0.76 and says 0.6.0 still wrote one.

Fix steps

0 of 3 done

Your check marks stay in this browser only.

How to check it worked

  • The log contains 📊 Starting HAR recording to and, after the browser stops, 📊 HAR file saved:. The path exists. HAR 1.2 has a top-level log object, which is the structure the report checked for.

If it still fails

  • Only HTTPS requests are recorded. The watchdog returns immediately when the URL is not HTTPS, with the note that only HTTPS requests are recorded for now. An http:// page can still leave entries empty. The report's page was https://example.com.
  • The file is written on BrowserStopEvent. The linked pull request does not describe a flush while the browser is still open. If startup fails, the log says Failed to enable HAR recording:.
  • A comment says The video and trace configurations aren't working either. Version 0.77/0.76. Pull request #3543 does not mention video or trace recording.

Sources and credit

Summarized in our own words from these public reports. Credit goes to their authors.

Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change

Hit an error we don't cover? Submit it