Skip to content

feat(resolver): wire visual_clip provider into URL resolution cascade#500

Merged
d-oit merged 1 commit into
mainfrom
feat/visual-clip-cascade-integration-4254538993565340695
Jul 3, 2026
Merged

feat(resolver): wire visual_clip provider into URL resolution cascade#500
d-oit merged 1 commit into
mainfrom
feat/visual-clip-cascade-integration-4254538993565340695

Conversation

@d-oit

@d-oit d-oit commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Integrated the visual_clip provider from the do-wdr-visual-resolver skill into the core URL resolution cascade.

Key changes:

  1. Model Update: Added VISUAL_CLIP to ProviderType in scripts/models.py and marked it as a paid provider.
  2. Provider Implementation: Created scripts/providers/visual_clip.py which wraps the VisualResolver. It handles both sync and async calls and implements availability checks based on API keys.
  3. Routing Logic: Modified scripts/routing.py to place visual_clip in the resolution order: jina -> firecrawl -> visual_clip -> mistral_browser -> direct_fetch.
  4. Cascade Wiring: Updated scripts/_url_resolve.py and scripts/_url_resolve_async.py to include visual_clip in their respective cascade maps.
  5. Query Support: Enhanced resolve_url and related functions to accept an optional query parameter, which is required by the visual resolver to identify relevant parts of the page.
  6. Verification: Added unit and integration tests in tests/test_resolve_visual.py to ensure correct wiring and behavior of the new provider within the cascade.

Fixes #476


PR created automatically by Jules for task 4254538993565340695 started by @d-oit

@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
do-web-doc-resolover Error Error Jul 3, 2026 6:59am

@deepsource-io

deepsource-io Bot commented Jul 1, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 16bf3bc...7bf7394 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

Important

Some issues found as part of this review are outside of the diff in this pull request and aren't shown in the inline review comments due to GitHub's API limitations. You can see those issues on the DeepSource dashboard.

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Jul 3, 2026 6:58a.m. Review ↗
Python Jul 3, 2026 6:58a.m. Review ↗
Rust Jul 3, 2026 6:58a.m. Review ↗
Shell Jul 3, 2026 6:58a.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@codacy-production

codacy-production Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 22 complexity · 11 duplication

Metric Results
Complexity 22
Duplication 11

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Comment thread scripts/_url_resolve.py
profile: Profile = Profile.BALANCED,
query: str | None = None,
) -> Generator[dict[str, Any]]:
logger.info(f"Resolving URL: {url}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Use lazy % formatting in logging functions


Formatting the message manually before passing it to a logging call does unnecessary work if logging is disabled. Consider using the logging module's built-in formatting features to avoid that.


def get_visual_resolver() -> VisualResolver:
"""Lazy initialization of the VisualResolver."""
global _visual_resolver

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Using the global statement


It is recommended not to use global statement unless it is really necessary. Global variables are dangerous because they can be simultaneously accessed from multiple sections of a program. This frequently results in bugs. This also make code difficult to read, because they force you to search through multiple functions or even modules just to understand all the different locations where the global variable is used and modified. Read more about why it should be avoided here.

Comment thread tests/test_resolve_visual.py Outdated
assert result["content"] == "Async visual content"
mock_resolver.resolve_async.assert_called_once_with(url, query)

def test_provider_type_enum(self):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Method doesn't use the class instance and could be converted into a static method


The method doesn't use its bound instance. Decorate this method with @staticmethod decorator, so that Python does not have to instantiate a bound method for every instance of this class thereby saving memory and computation. Read more about staticmethods here.

Comment thread tests/test_resolve_visual.py Outdated
@d-oit d-oit changed the title Wire visual_clip provider into URL resolution cascade feat(resolver): wire visual_clip provider into URL resolution cascade Jul 2, 2026
@d-oit

d-oit commented Jul 2, 2026

Copy link
Copy Markdown
Owner Author

Reopening to trigger fresh CI with corrected title and formatting

@d-oit d-oit closed this Jul 2, 2026
@d-oit d-oit reopened this Jul 2, 2026
@d-oit d-oit force-pushed the feat/visual-clip-cascade-integration-4254538993565340695 branch from fbc73cf to 8168026 Compare July 2, 2026 14:42
@d-oit d-oit force-pushed the feat/visual-clip-cascade-integration-4254538993565340695 branch from 8168026 to bba3e73 Compare July 2, 2026 15:11
@d-oit d-oit force-pushed the feat/visual-clip-cascade-integration-4254538993565340695 branch from 6717940 to 6ca11bc Compare July 2, 2026 15:29
@d-oit d-oit force-pushed the feat/visual-clip-cascade-integration-4254538993565340695 branch from 6ca11bc to 63d9d1e Compare July 2, 2026 15:39
@d-oit d-oit force-pushed the feat/visual-clip-cascade-integration-4254538993565340695 branch from 63d9d1e to d10a29a Compare July 2, 2026 15:59
@d-oit d-oit force-pushed the feat/visual-clip-cascade-integration-4254538993565340695 branch from d10a29a to 4dfc671 Compare July 2, 2026 16:09
@d-oit d-oit force-pushed the feat/visual-clip-cascade-integration-4254538993565340695 branch from 4dfc671 to 7554c91 Compare July 2, 2026 16:21
@d-oit d-oit force-pushed the feat/visual-clip-cascade-integration-4254538993565340695 branch from 7554c91 to e4f0c55 Compare July 2, 2026 16:33
@d-oit d-oit force-pushed the feat/visual-clip-cascade-integration-4254538993565340695 branch from e4f0c55 to e32d28b Compare July 2, 2026 17:09
@d-oit d-oit force-pushed the feat/visual-clip-cascade-integration-4254538993565340695 branch from e32d28b to 37dd16b Compare July 3, 2026 06:35
Integrated the visual_clip provider into the core URL resolution
cascade. Added VISUAL_CLIP to ProviderType, created
scripts/providers/visual_clip.py, modified routing and cascade maps,
and added query parameter support. Fixes #476
@d-oit d-oit force-pushed the feat/visual-clip-cascade-integration-4254538993565340695 branch from 37dd16b to 7bf7394 Compare July 3, 2026 06:58
@d-oit d-oit merged commit 3f2ac1a into main Jul 3, 2026
49 of 51 checks passed
@d-oit d-oit deleted the feat/visual-clip-cascade-integration-4254538993565340695 branch July 3, 2026 07:19
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.

Wire visual_clip provider into URL resolution cascade

2 participants