diff --git a/README.md b/README.md index 8ed4097..c2ff104 100644 --- a/README.md +++ b/README.md @@ -164,6 +164,8 @@ ra-aid -m "Add new feature" --verbose - `--hil, -H`: Enable human-in-the-loop mode for interactive assistance during task execution - `--chat`: Enable chat mode with direct human interaction (implies --hil) - `--verbose`: Enable verbose logging output +- `--experimental-fallback-handler`: Enable experimental fallback handler to attempt to fix too calls when they fail 3 times consecutively. +- `--pretty-logger`: Enables panel markdown formatted logger messages for debugging purposes. - `--temperature`: LLM temperature (0.0-2.0) to control randomness in responses - `--disable-limit-tokens`: Disable token limiting for Anthropic Claude react agents - `--recursion-limit`: Maximum recursion depth for agent operations (default: 100) diff --git a/ra_aid/__main__.py b/ra_aid/__main__.py index e027a08..84abc2e 100644 --- a/ra_aid/__main__.py +++ b/ra_aid/__main__.py @@ -155,6 +155,11 @@ Examples: action="store_true", help="Disable fallback model switching.", ) + parser.add_argument( + "--experimental-fallback-handler", + action="store_true", + help="Enable experimental fallback handler.", + ) parser.add_argument( "--fallback-tool-models", type=str, @@ -407,6 +412,7 @@ def main(): "auto_test": args.auto_test, "test_cmd": args.test_cmd, "max_test_cmd_retries": args.max_test_cmd_retries, + "experimental_fallback_handler": args.experimental_fallback_handler, } # Store config in global memory for access by is_informational_query diff --git a/ra_aid/agent_utils.py b/ra_aid/agent_utils.py index 62c78f1..5b0d6ca 100644 --- a/ra_aid/agent_utils.py +++ b/ra_aid/agent_utils.py @@ -861,8 +861,10 @@ def get_agent_type(agent: RAgents) -> Literal["CiaynAgent", "React"]: def init_fallback_handler(agent: RAgents, config: Dict[str, Any], tools: List[Any]): """ - Initialize fallback handler if agent is of type "React"; otherwise return None. + Initialize fallback handler if agent is of type "React" and experimental_fallback_handler is enabled; otherwise return None. """ + if not config.get("experimental_fallback_handler", False): + return None agent_type = get_agent_type(agent) if agent_type == "React": return FallbackHandler(config, tools) diff --git a/ra_aid/config.py b/ra_aid/config.py index 54d7995..2f5eab0 100644 --- a/ra_aid/config.py +++ b/ra_aid/config.py @@ -2,10 +2,9 @@ DEFAULT_RECURSION_LIMIT = 100 DEFAULT_MAX_TEST_CMD_RETRIES = 3 -DEFAULT_MAX_TOOL_FAILURES = 2 +DEFAULT_MAX_TOOL_FAILURES = 3 FALLBACK_TOOL_MODEL_LIMIT = 5 RETRY_FALLBACK_COUNT = 3 -RETRY_FALLBACK_DELAY = 2 VALID_PROVIDERS = [ "anthropic",