mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-19 12:11:02 -04:00
[GH-ISSUE #341] Feature Request: Configurable fallback when tools or models fail, including optional safe tool installation #110
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Akalanka1337 on GitHub (Jun 6, 2026).
Original GitHub issue: https://github.com/vxcontrol/pentagi/issues/341
Originally assigned to: @asdek on GitHub.
Target Component
AI Agents (Researcher/Developer/Executor)
Enhancement Description
Summary
I would like to request a new fallback feature for PentAGI.
Currently, when an agent fails to execute a tool, repeats the same tool, reaches retry limits, or the selected model cannot produce a valid tool call, PentAGI retries and may use the reflector/mentor logic. But after the limit is reached, the flow can still fail or stop.
Can we add an optional fallback mode where the agent tries another safe path before stopping?
Current behavior I noticed
From the source/docs, PentAGI already has:
This means the system already has most building blocks needed for fallback.
Requested behavior
Add a configurable fallback layer that runs before the task/subtask is marked failed.
When enabled, if a tool or model fails repeatedly, the agent should be able to:
Example cases
Search tool failure
If Tavily fails, the agent could try:
Instead of stopping immediately.
Missing CLI tool
If the agent tries to use a command but it is missing, for example:
Then the agent could:
Model/tool-call failure
If the current model repeatedly fails to produce valid tool calls, PentAGI could retry the same chain with a configured fallback model.
Example:
Suggested config
Possible implementation idea
This could be added around the current retry/error handling path.
Possible places:
A possible flow:
Safety requirements
Because this is a pentesting platform, auto-install should be safe and controlled.
Recommended rules:
Why this would help
This would make PentAGI more resilient for real autonomous workflows.
Benefits:
Acceptance criteria
Technical Details
No response
Designs and Mockups
No response
Alternative Solutions
No response
Verification
@kehansama commented on GitHub (Jun 6, 2026):
Excellent analysis of the fallback architecture. The multi-layered approach you've outlined — tool fallback → installer fallback → model fallback — maps exactly to what we're seeing as a critical gap in the AI agent ecosystem right now.
One observation from our work on AgentRelay (an agent orchestration & tool-routing middleware): the hardest part isn't the fallback logic, it's the capability discovery layer. Before an agent can fall back to "a similar tool," it needs a unified capability registry that maps abstract capabilities (e.g., "web_search", "code_execution", "file_read") to concrete tool implementations across different providers.
Your config proposal is very close to what we've found works in practice. One addition I'd suggest: a capability similarity graph. For example, if Tavily fails, the system should know that DuckDuckGo and Searxng are "high similarity" (both web search) while Google Search API is "medium similarity" (different rate limits, different auth model). This prevents the fallback from picking a tool that's nominally available but semantically mismatched.
Also worth noting: the model fallback layer you describe is where cross-platform agent relay becomes critical. If the primary model fails tool-call generation, falling back to a different provider requires maintaining session state and tool schema compatibility — something we've solved with an adapter layer in AgentRelay.
Happy to share more implementation details if useful. This is a well-specified enhancement and would make PentAGI significantly more resilient in production.