Fix/async path parity - #122
Merged
Merged
Conversation
The sync ReconAgent called dns_tool.detect_subdomains, returning
{subdomains: [str]}, while AsyncOrchestrator called
subdomain_enum.enumerate_subdomains_async, returning {found: [{fqdn}]}.
Both wrote the same recon.subdomains KB key, so any consumer of that key
was correct for exactly one of the two pipeline paths. The sync agent also
used the weaker of the two enumerators (11 hardcoded prefixes, sequential).
Move the sync agent and the MCP subdomain_enum tool onto enumerate_subdomains
and add fqdns() as the single place that derives bare hostnames for
ReconResult.subdomains, so the shape cannot drift again.
AsyncReconAgent runs only nmap, dns, subdomains and tls, so recon.whois was never written and ReconResult.whois stayed empty whenever the pipeline went through AsyncOrchestrator, while the sync ReconAgent filled both. Offload the blocking lookup with asyncio.to_thread the same way the LLM endpoint detector is already handled, and feed the result into ReconResult.
AsyncReconAgent has no web branch, so recon.web_surface was never written under AsyncOrchestrator. Both of its consumers — build_kb_graph, which turns endpoints into HTTP_ENDPOINT nodes for the planner, and ExploitAgent, which reads the key to pick injection points — saw an empty surface, so the entire web layer was dead on the async path while working on the sync one. Reuse ReconAgent._run_web_recon through asyncio.to_thread instead of re-deriving the crawl and its findings in the orchestrator, gated by the same use_web_recon flag as the sync path.
_acall_ollama constructed its own payload and had drifted from the sync one: it dropped the system prompt entirely, omitted the raised num_ctx that keeps long exploit prompts inside the context window, and allowed half the timeout. Any agent migrated to acall would have lost its system prompt silently. Extract _ollama_request as the single builder both paths call and hoist the timeout into OLLAMA_TIMEOUT, so the two cannot diverge again.
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
No description provided.