test(tools): comprehensive test suite for get_github_advisory and search_for_exploits - #92
Merged
Merged
Conversation
This was referenced Jul 5, 2026
This was referenced Aug 4, 2026
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
Adds
tests/test_github_tools.py— a 66-test suite coveringget_github_advisoryand
search_for_exploits, both of which power steps 4 and 7 of themanus-agent analyzepipeline via the VI agent but had zero functional tests in the repository.
Why these two tools?
Both tools query the GitHub API and are registered directly in
vi_agent.py:get_github_advisory— fetches GitHub Security Advisories (GHSA) for a CVE;used at step 4 of the VI pipeline
search_for_exploits— searches GitHub for PoC exploit repositories for a CVE;used at step 7 alongside
search_exploit_dbandsearch_packetstormBefore this PR:
get_github_advisoryhad 1 importability test (intest_packageability.py) and no functional coveragesearch_for_exploitshad 1 importability test (intest_packageability.py) and no functional coverageWhat is tested
get_github_advisory@tooldecorator compatibilityNone, integer, GHSA-format IDssummary/severity/cve_id/ghsa_idfields,only the first entry returned when multiple advisories are present, lowercase cve- prefix
normalisation, GitHub token injected into
Authorizationheader whenGITHUB_TOKENis setmessagekey; HTTP 404 →messagekey (noterror)ConnectionError,Timeout, HTTP 500, HTTP 403, empty-dict response structurevi_agent.pyimportsget_github_advisory; system prompt references GitHubsearch_for_exploitsname,description,requiredfields,cve_idtype,toolUseIdechoNone, integer, missing key →status: errorstatus: success,linkspresent, capped at ≤5 results, required fields(
name,url,stars,description,last_updated) in each entry,summaryfield withtotal_count,toolUseIdecho, GitHub token injected, correct API endpoint, CVE ID in querystatus: successwithlinks: []and appropriate summaryConnectionError,Timeout, HTTP 403 (rate-limit), HTTP 422, JSON decode errorvi_agent.pyimportssearch_for_exploits; system prompt references exploitsTest quality
@patch("...requests.get")throughoutmonkeypatch.setenv)ruff check . --fix && ruff formatcleanOpen PRs checked (no overlap confirmed)
Checked against all open PRs before building to confirm no duplication:
#51 (silent-patches tool), #53 (cve-timeline), #54 (version-range), #58 (vendor-response),
#60 (poc-freshness), #64 (sbom-scan), #65 (temporal-priority), #67 (cluster-variants),
#74 (epss-decay-detector), #75 (exploit-maturity-classifier), #76 (vulnerability-triage-card),
#77 (cve-report-generator), #78 (diff-report), #79 (reachability-scorer),
#80 (epss-watchlist), #82 (attack-surface-scorer), #83 (watch-alert),
#85 (cli-integration-tests), #86 (patch-lag-rating), #87 (kev-context-dimension),
#88 (readme-scoring-workflow), #89 (core-tools-test-suite for check_cisa_kev/get_nvd_data/get_cwe_details/get_otx_cve_details),
#90 (exploit-search-tools-tests for search_exploit_db/search_packetstorm/query_threat_intel/obtain_cves),
#91 (nvd-retry-backoff)
PR #89 covers
check_cisa_kev,get_nvd_data,get_cwe_details,get_otx_cve_details.PR #90 covers
search_exploit_db,search_packetstorm,query_threat_intelligence_feeds,obtain_cves.This PR covers
get_github_advisoryandsearch_for_exploits— neither appears in any open or merged PR.