Skip to content

Fix/async path parity - #122

Merged
evkir merged 4 commits into
mainfrom
fix/async-path-parity
Jul 30, 2026
Merged

Fix/async path parity#122
evkir merged 4 commits into
mainfrom
fix/async-path-parity

Conversation

@evkir

@evkir evkir commented Jul 30, 2026

Copy link
Copy Markdown
Owner

No description provided.

evkir added 4 commits July 30, 2026 20:53
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-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 96.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cyberai/mcp/tools.py 50.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@evkir
evkir merged commit d624520 into main Jul 30, 2026
5 checks passed
@evkir
evkir deleted the fix/async-path-parity branch July 30, 2026 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants