Added a docs researcher subagent using Context7.#841
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
@daiv-agent /code-review |
Code ReviewOverview
FindingsHigh Severity
Medium Severity
Low Severity
Suggestions
TestsWhat should be run: make lint-fix
make testCoverage notes:
Identified gaps:
|
- Add WEB_FETCH_AUTH_HEADERS setting for domain-specific auth (e.g. Context7 API) - Inject auth headers in web_fetch middleware for authenticated endpoints - Enhance docs-researcher system prompt with structured guidelines - Reorganize create_explore_subagent and update tool names in prompts - Update integration and unit tests Co-authored-by: Cursor <cursoragent@cursor.com>
|
@daiv-agent /security-audit |
Security AuditSummary
FindingsCritical Severity
High Severity
Medium Severity
Low Severity
Recommendations
Tests/ValidationRequired Security Tests (add to @pytest.mark.parametrize("url", [
"http://127.0.0.1/admin",
"http://localhost:8000/",
"http://169.254.169.254/latest/meta-data/",
"http://10.0.0.1/internal",
"http://192.168.1.1/config",
"http://[::1]/admin",
])
async def test_rejects_ssrf_urls(url):
result = await web_fetch_module.web_fetch_tool.ainvoke({"url": url, "prompt": ""})
assert "private" in result.lower() or "blocked" in result.lower()
async def test_cache_key_includes_auth_headers(httpx_mock):
# Test that different auth headers produce different cache entries
cache.clear()
httpx_mock.add_response(url="https://api.example.com", status_code=200, text="DATA")
with patch.object(web_fetch_module, "settings") as mock_settings:
mock_settings.WEB_FETCH_AUTH_HEADERS = {"example.com": {"X-Key": "key1"}}
result1 = await web_fetch_module.web_fetch_tool.ainvoke({"url": "https://api.example.com", "prompt": "Q"})
mock_settings.WEB_FETCH_AUTH_HEADERS = {"example.com": {"X-Key": "key2"}}
result2 = await web_fetch_module.web_fetch_tool.ainvoke({"url": "https://api.example.com", "prompt": "Q"})
assert result1 != result2 # Should fetch twice with different authManual Tests:
|
|
@daiv-agent fix only this identified errors:
|
SummaryFixed both identified security issues: 1. SSRF Protection
2. Subdomain Matching Documentation Fix
All tests pass successfully, including the new SSRF protection tests and existing web_fetch tests. |
tests/unit_tests/automation/agent/middlewares/test_web_fetch.py
Dismissed
Show dismissed
Hide dismissed
|
@daiv-agent /code-review |
Code ReviewOverview
FindingsHigh Severity
Medium Severity
Low Severity
Suggestions
TestsWhat was run: make lint-fix
pytest tests/unit_tests/automation/agent/middlewares/test_web_fetch_ssrf.py (37 tests)
pytest tests/unit_tests/automation/agent/middlewares/test_web_fetch.py (21 tests)Coverage:
Gaps:
Recommended additional tests: # Add to test_is_private_or_local
("::ffff:127.0.0.1", True), # IPv4-mapped IPv6 loopback
("::ffff:192.168.1.1", True), # IPv4-mapped IPv6 private
("FE80::1", True), # Uppercase IPv6
("224.0.0.1", True), # Multicast IPv4
("ff02::1", True), # Multicast IPv6What should be run before merge: make test # Full test suite
make lint-fix # Already passed |
|
@daiv-agent Apply this recommendations:
|
|
Perfect! All tests are passing. Let me create a summary of the changes: SummarySuccessfully applied the recommended improvements: 1. Moved repeated
|
No description provided.