mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-20 23:57:11 -04:00
[PR #157] [CLOSED] fix: treat screenshot failure as non-critical in browser tool #200
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/vxcontrol/pentagi/pull/157
Author: @atian8179
Created: 3/1/2026
Status: ❌ Closed
Base:
master← Head:fix/browser-screenshot-non-blocking📝 Commits (1)
8e0c1dafix: treat screenshot failure as non-critical in browser tool📊 Changes
1 file changed (+6 additions, -3 deletions)
View changed files
📝
backend/pkg/tools/browser.go(+6 -3)📄 Description
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
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.