Repository navigation
fix: knowledge truncation, CI concurrency test coverage, changelog housekeeping - #411
Merged
Merged
Conversation
Uncapped, a single call at the default limit=5 could put ~50K chars of citable text on the wire (25x the FAQ cap). Adds _MAX_CITABLE_DOCSTRING_CHARS and corrects the citable-payloads test docstring, which had wrongly assumed this tool's snippets were already truncated by search.py.
…espx Matches the respx-boundary pattern already used by TestFetchPageReportsFailureStructurally in the same file and this project's no-mocks-of-business-logic policy. Found and fixed a respx route-shadowing gotcha along the way: a bare host URL with no path matches any path on that host, so a more specific route registered after it is silently shadowed.
neuromechanist
requested review from
yarikoptic
and removed request for
yarikoptic
September 19, 2026 19:19
Name DOCSTRING_SNIPPET_MAX_LENGTH explicitly instead of the ambiguous 'above' (the adjacent constant is the unrelated FAQ cap). Anchor the remaining bare-host respx routes in TestFetchPageContentImpl with a trailing slash for defense against the route-shadowing gotcha this same PR found, even though each currently registers only one route.
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
Addresses a subset of the PR #403 review findings (the release PR merging develop into main), split from two other fix PRs covering security/config and citation-placement findings.
create_get_full_docstring_tool's citable text path was uncapped (text=lambda r: r.snippet), unlike the sibling FAQ tool. At the defaultlimit=5this could put ~50K chars on the wire per call (docstrings are capped at 10K chars each at ingest). Adds_MAX_CITABLE_DOCSTRING_CHARS = 4000and atruncate()wrap, plus a regression test mirroring the existing FAQ cap test. Also corrects a test-file docstring that had wrongly assumed this tool's snippets were already truncated upstream bysearch.py(onlysearch_docstrings' are).docker-build.ymlconcurrencyblock (the actual fix for the real v0.8.9:latest-tag race) had no test coverage, unlike the semverenable=logic next to it. Adds two tests totest_latest_tag_policy.pythat parse the real YAML and assert the concurrency group/cancel-in-progress behavior.CHANGELOG.mdstill said[Unreleased]despite being the version this release PR ships (0.8.10, persrc/version.py). Retitles per the changelog's own stated convention, adds a fresh[Unreleased]above it, and adds PR fix: improve citation quality and streaming presentation #399 to the citation-fix bullet (PR fix: move citations to sentence boundaries #400 is an explicit follow-up to it) plus a new bullet for fix: improve citation quality and streaming presentation #399's knowledge-search relevance tightening, which had no changelog entry anywhere.TestFetchPageContentImplintests/test_agents/test_page_context.pymockedhttpx.Clientdirectly viaunittest.mock, inconsistent with this project's no-mocks-of-business-logic policy and with the respx-basedTestFetchPageReportsFailureStructurallyclass right below it testing the same underlying function. Converted all 10 tests to respx. Along the way, found and fixed a real respx gotcha: a bare host URL with no path (respx.get("https://example.com")) matches any path on that host, silently shadowing a more specific route registered after it — this broke the two-hop redirect tests until anchored with an explicit trailing slash.Test plan
uv run ruff check .cleanuv run pytest tests/test_tools/test_citation_gating.py tests/test_latest_tag_policy.py tests/test_agents/test_page_context.py -vall passuv run pytest tests/test_agents/ tests/test_tools/ tests/test_knowledge/ tests/test_latest_tag_policy.py -q— 740 passed