fix: treat screenshot failure as non-critical in browser tool#157
Closed
atian8179 wants to merge 1 commit intovxcontrol:masterfrom
Closed
fix: treat screenshot failure as non-critical in browser tool#157atian8179 wants to merge 1 commit intovxcontrol:masterfrom
atian8179 wants to merge 1 commit intovxcontrol:masterfrom
Conversation
Screenshot capture is a non-critical side-effect — its only purpose is to write a PNG to disk for logging. When it fails (scraper down, timeout, small image), the successfully-fetched page content was being discarded and an error returned to the AI agent. Change all three browser methods (ContentMD, ContentHTML, Links) to log a warning on screenshot failure instead of returning an error, preserving the successfully-fetched content for the agent. Closes vxcontrol#149
Contributor
|
thank you for the PR, but these changes were included by #150 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In
backend/pkg/tools/browser.go, theContentMD,ContentHTML, andLinksmethods run two concurrent operations: fetching page content and capturing a screenshot. If the screenshot fails (scraper unavailable, timeout, image too small), the function returns an error discarding successfully-fetched page content.The AI agent receives an error instead of the content it needs. Screenshot is a non-critical side-effect —
PutScreenshotalready ignores errors at the call-site.Reported in #149.
Solution
Log a warning on screenshot failure instead of returning an error. Content is preserved.
Changes
backend/pkg/tools/browser.go: 3 methods changed —ContentMD(),ContentHTML(),Links()(+6/-3)Testing
Closes #149