Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

MagMueller
Copy link
Collaborator

@MagMueller MagMueller commented Sep 6, 2025

Auto-generated PR for branch: fix-downloads-dedup-clean


Summary by cubic

Fixes duplicate local download events by ensuring each download is dispatched once, and hardens download handling for both local and remote sessions.

  • Bug Fixes
    • Add a “handled” guard to dedupe dispatch across CDP progress, JS fetch, and polling paths.
    • Disable JS fetch fallback for local downloads (behind a _use_js_fetch_for_local flag) to avoid double-dispatch.
    • Improve remote handling: emit completion using suggestedFilename when filePath is missing; never touch local FS.
    • Move CDP handlers outside try, track handler tasks, and clean up on completion for better stability.

cursor[bot]

This comment was marked as outdated.

Copy link

github-actions bot commented Sep 6, 2025

Agent Task Evaluation Results: 3/4 (75%)

View detailed results
Task Result Reason
amazon_laptop ✅ Pass The agent successfully navigated to amazon.com, searched for 'laptop', and returned the name and details of the first laptop result. The output includes the product title, price, specifications, and other relevant information, fulfilling the task requirements.
google_maps_3d ❌ Fail The agent successfully navigated to www.google.com/maps, searched for ETH Zurich Hauptgebäude, closed the side panel, switched to Satellite View, and enabled 3D mode as required. However, the agent was unable to pan the map such that both ETH Zurich Hauptgebäude and Zurich Lake were clearly visible together in one frame. Since this final criterion was not met, the task is considered incomplete and thus unsuccessful.
browser_use_pip ✅ Pass The agent correctly identified and provided the pip installation command 'pip install browser-use' as required by the task. The output includes the exact command and references the official PyPI project page, fulfilling the success criteria.
captcha_cloudflare ✅ Pass The agent successfully solved the captcha on the specified page, clicked 'Check', waited for completion, and extracted the hostname value as 'example.com', which matches the expected result. Therefore, all criteria for success have been met.

Check the evaluate-tasks job for detailed task execution logs.

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.

2 issues found across 1 file

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

This commit updates the DownloadsWatchdog class to ensure that the downloads directory path is properly expanded and resolved to an absolute path. The changes include:

- Expanding the downloads path using `expanduser()` and `resolve()` methods to handle user home directories correctly.
- Updating the download behavior settings to use the expanded path.
- Ensuring that the downloads directory is created with the resolved path.

Additionally, the example feature for downloading files has been modified to use a temporary downloads path for testing purposes.
This commit modifies the `download_file.py` example to replace the `BrowserSession` and `BrowserProfile` with the new `Browser` class. The changes streamline the code and enhance clarity by directly utilizing the `Browser` for managing downloads. The download path remains set to a temporary directory for testing purposes.
cursor[bot]

This comment was marked as outdated.

This commit updates the DownloadsWatchdog class to specify exception types in the error handling logic, replacing broad exception catches with more precise ones (AssertionError, KeyError, AttributeError). Additionally, it adds a warning log when no downloads path is configured, ensuring better error visibility and handling during download operations.
# Skip if already handled by progress/JS fetch
info = self._cdp_downloads_info.get(guid, {})
if info.get('handled'):
return
Copy link

Choose a reason for hiding this comment

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

Bug: Download Deduplication Fails with Empty GUIDs

The new download deduplication logic can incorrectly skip downloads. If a GUID is empty, multiple downloads might share a 'handled' status. In the polling loop, the deduplication check uses the initial event's GUID, which can skip legitimate concurrent downloads. Also, downloads detected via polling are no longer tracked in browser_session._downloaded_files, leading to inconsistent tracking.

Fix in Cursor Fix in Web

@MagMueller MagMueller merged commit 1491917 into main Sep 6, 2025
57 checks passed
@MagMueller MagMueller deleted the fix-downloads-dedup-clean branch September 6, 2025 23:25
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