Repository navigation
Conversation
r.jina.ai caches a rendered page for an hour, so a plain fetch could return a stale snapshot - and worse, someone else's cache of that address, carrying Jina's own cached-snapshot warning. An agent handed that cache reasons about the wrong page. Send x-no-cache: true so the reader skips its cache and returns the page at that address now. Fixes Agent-Field#1771
Contributor
Author
|
Closing as a duplicate of #1915, which the issue author opened first and which is the more complete fix. Both send Deferring to #1915. |
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
codeaf web fetch https://example.comcould return r.jina.ai's own stale cached snapshot (a "Test Document" page carrying Jina's cached-snapshot warning) instead of the live page. The model's web tool goes through the same reader, so a model asked to read a page could be handed someone else's cache of it without knowing.Fixes #1771.
Fix
r.jina.ai caches a rendered page for an hour (lifetime 3600s). The fetch now sends
x-no-cache: true, documented by Jina as bypassing the cached page, so what comes back is the page at that address now rather than a stale or foreign snapshot.One line in
internal/search/jina.go'sFetch. The keyed/unkeyed paths and verbatim-URL routing are unchanged.Tested
TestJinaFetchBypassesTheCacheininternal/search/search_test.goasserts the fetch request carriesx-no-cache: true(red before the fix, green after), using the package's existing httptest pattern - no network.go test ./internal/search/ -count=1passes;go vet ./internal/search/clean.Acceptance
The issue's e2e (
codeaf web fetch https://example.comcontainsExample Domain) needs a live network and is not run in CI; the unit test covers the mechanism deterministically.