Repository navigation
[fix] Deduplicate llms.txt pages before applying the URL limit - #10671
Open
lakers-abing wants to merge 1 commit into
Open
lakers-abing wants to merge 1 commit into
lakers-abing wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Summary
Fixes #10670.
With llms.txt entries
A, A, Bandmax_urls=2, the reader fetches A twice, emits it twice, and skips B. Deduplicate resolved URLs before applying the limit in both sync and async reads. Preserve the first entry's metadata and ordering; leave the index parser unchanged.Type of change
Checklist
./scripts/format.shand./scripts/validate.sh)Duplicate and AI-Generated PR Check
Additional Notes
Nine new cases cover sync/async reads, limits of 0/1/2/20, relative/absolute aliases, duplicates across sections, request counts, document contents, metadata, and unchanged index-parser output. HTTP responses use
httpx.MockTransport, without live network or model calls.python -m pytest libs/agno/tests/unit/reader/test_llms_txt_duplicate_urls.py libs/agno/tests/unit/tools/test_llms_txt.py -q: 73 passed../scripts/format.sh,./scripts/validate.sh, andgit diff --check: passed, including full Agno/agnoctl mypy and cookbook checks.Validation used the existing macOS ARM64/Python 3.12.14 development environment. The full repository test suite and live integrations were not run. URL equality is based on the parser's resolved URL strings; this change does not introduce broader URL canonicalization or change allowed-host policy. Existing PR #10207 addresses asynchronous chunking, a separate behavior; its source diff does not deduplicate links.
Generated by Codex with the account holder's authorization. Codex performed reproduction, code review, and checks; no independent human code review is claimed. No public API or cookbook change is needed.