Repository navigation
fix(browser): say when a site blocks the built-in browser - #261
Merged
Merged
Conversation
Asked for Coupang prices, the headless browser got "Access Denied", and the model quietly answered from web search snippets as if it had read them on Coupang, without telling the person to connect their Chrome. - browser/blocked.ts: one helper that reads the title and the start of a short page for Access Denied, 403 Forbidden, captchas (also 보안문자 / 자동입력 방지), robot checks and Cloudflare challenges. - A blocked reading from the built-in browser is tried once in the person's Chrome when it is linked now. Otherwise the result starts with `Blocked: <host> showed <sign> ...`, which tells the model to tell the person, to say an answer from search results comes from search results and not the site, and (once per session) how to connect their Chrome. The TUI gets metadata.connect for its how-to-connect line. - The browser tool description says shops, bookings, sign-ins and bot checks need the browser tool, not web search. The browser and web search descriptions both say to state when an answer comes from search results because the site blocked the browser.
Member
Author
|
Self-review.
|
Merged
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.
What's done
A real run of "쿠팡에서 에어팟 프로 3 가격 찾아서 제일 싼 거 3개 알려줘" got
Access Deniedfrom Coupang in the headless browser. The model then quietly answered from web search snippets as if it had read them on Coupang.packages/redrob/src/browser/blocked.ts:blocked({title, text})names the block. It covers Access Denied, 403 Forbidden, captcha (also 보안문자 and 자동입력 방지), robot checks, Cloudflare challenges and generic block pages. It only checks the title and pages under 3,000 characters, so a site that merely mentions reCAPTCHA is not flagged.UserBrowser.onBlocked: when a reading from the built-in browser is blocked and the person's Chrome is linked right now, the page is opened once in their Chrome. Otherwise the result getsBlocked: <host> showed <sign> to this headless browser, so nothing below is the site's content.That line tells the model to tell the person, to say that an answer from search results comes from search results and not from the host, and, once per session, how to connect their Chrome (the fix(tui): show browser tool calls in the person's language #260 line, plusmetadata.connectfor the TUI).browser.txt: use this tool, not web search, for prices and stock in a shop, bookings, anything behind a sign-in, or a site with a bot check. It runs in the person's Chrome whenever that is linked (unchanged:UserBrowser.acttries the linked Chrome first on every call). Bothbrowser.txtandwebsearch.txtsay to state when the answer comes from search results because the site blocked the browser.What's not done
Checks
test/browser/blocked.test.ts: 13 tests (each block sign, sites that are not blocks, the note with the connect line once per session, the retry in a linked Chrome, the description text).test/browserandtest/tool/websearch.test.ts: 43 pass.tsgo --noEmitpasses.bun run --conditions=browser ./src/index.ts run --format json:browser open coupangreturnedBlocked: www.coupang.com showed Access Denied …, thenwebsearch. The answer opens with "쿠팡 웹사이트가 자체 브라우저의 직접 접근을 차단(Access Denied)하여, 검색 결과에 수집된 쿠팡 판매 가격 … 시점 차이로 인해 현재 가격과 약간 다를 수 있음" and ends with how to connect Chrome with the Redrob extension.