Commit Graph

402 Commits

Author SHA1 Message Date
Ariel Frischer d5e2e0a9a0 refactor(agent_utils.py, ciayn_agent.py): remove unused import cpm to clean up code and improve readability
style(tests): format code for better readability and consistency in test files
test(tests): update assertions and test cases for better clarity and maintainability
2025-02-14 13:04:41 -08:00
Ariel Frischer 7a2c766824 test(agent_utils): add config parameter to mock_ciayn assertions for better clarity and flexibility in tests 2025-02-13 20:18:02 -08:00
Ariel Frischer 90b3070aa2 chore(agent_utils.py): remove debug print statement for config to clean up output
chore(fallback_handler.py): comment out cpm call for tool call result to reduce logging noise
2025-02-13 20:14:07 -08:00
Ariel Frischer efec91579a refactor(ciayn_agent.py): remove unnecessary raise statement and debug log to clean up code 2025-02-13 20:09:47 -08:00
Ariel Frischer 15ce534f8f feat(agent_utils.py): add debug print for config to assist in troubleshooting
feat(ciayn_agent.py): pass config to CiaynAgent for improved functionality
fix(ciayn_agent.py): handle tool execution errors more gracefully with msg_list
feat(fallback_handler.py): enhance handle_failure method to utilize msg_list for better context
feat(fallback_handler.py): implement init_msg_list to manage message history effectively
test(test_fallback_handler.py): add unit tests for init_msg_list to ensure correct behavior
2025-02-13 20:09:21 -08:00
Ariel Frischer 9caa46bc78 refactor(agent_utils.py): remove redundant agent_type parameter from _handle_fallback_response and run_agent_with_retry functions to simplify function signatures
feat(agent_utils.py): retrieve agent_type within _handle_fallback_response to maintain functionality while improving code clarity
2025-02-13 19:16:13 -08:00
Ariel Frischer 5733eb06f5 fix(test_fallback_handler.py): update lambda function to accept default argument for args to prevent potential errors during invocation 2025-02-13 19:14:06 -08:00
Ariel Frischer cc1945facd feat(agent_utils.py): change SystemMessage to HumanMessage for fallback responses in React to improve message clarity
fix(fallback_handler.py): update tool invocation logic to handle missing tools and raise appropriate exceptions for better error handling
test(tests): add comprehensive tests for fallback handler functionality, including loading models, extracting tool names, and invoking tools to ensure robustness and reliability
2025-02-13 18:48:45 -08:00
Ariel Frischer 09abba512d test(tests): add tests for fallback handler to ensure proper error handling and counter incrementing
feat(tests): introduce FallbackToolExecutionError to improve error specificity in fallback handling tests
2025-02-13 18:21:54 -08:00
Ariel Frischer 15a3291254 refactor(agent_utils.py): remove unnecessary debug log statement to clean up code
refactor(fallback_handler.py): improve error handling by raising a specific exception when all fallback models fail
test(fallback_handler.py): update tests to reflect changes in the fallback handler's error handling and initialization
fix(test_llm.py): update error messages in tests for unsupported providers to be more descriptive and accurate
2025-02-13 18:20:00 -08:00
Ariel Frischer ac13ce746a feat(agent_utils.py): add cpm function import for enhanced logging in run_agent_with_retry
fix(agent_utils.py): set default value of fallback_handler to None in run_agent_with_retry
chore(ciayn_agent.py): comment out debug log for generated code to reduce verbosity
fix(fallback_handler.py): change fallback_enabled config key to experimental_fallback_handler for better clarity
refactor(test_ciayn_agent.py): update invoke method in DummyModel to return AIMessage instead of a custom Response class
test(test_ciayn_agent.py): comment out test_retry_logic_with_failure_recovery for future implementation and focus on existing tests
2025-02-13 17:57:27 -08:00
Ariel Frischer c7712e0114 fix(tests): update type hints in test_agent_utils.py for better clarity and type safety
refactor(tests): modify DummyAgent's stream method to use more descriptive parameter names and types for improved readability
2025-02-13 17:10:26 -08:00
Ariel Frischer cd8d1c459d feat(readme): document new command line arguments for experimental features
feat(main.py): add --experimental-fallback-handler argument to enable fallback handler
fix(agent_utils.py): modify init_fallback_handler to check for experimental fallback handler flag
fix(config.py): increase DEFAULT_MAX_TOOL_FAILURES to allow more retries before failure
2025-02-13 17:01:46 -08:00
Ariel Frischer 2420dfbb4f refactor(agent_utils.py): extract fallback handler initialization into a separate function to improve code readability and maintainability
fix(ciayn_agent.py): reset fallback handler after executing tool to ensure proper state management
style(fallback_handler.py): format method signature for better readability
2025-02-13 16:53:22 -08:00
Ariel Frischer 63e48db9de feat(agent_utils.py): add _handle_fallback_response function to streamline fallback handling logic
refactor(agent_utils.py): extract fallback handling logic from run_agent_with_retry to improve code readability
fix(ciayn_agent.py): update stream method parameter name for consistency
chore(agents_alias.py): reorder import statements to follow best practices
style(fallback_handler.py): reorder exception imports for consistency and clarity
2025-02-13 16:47:31 -08:00
Ariel Frischer 115cde98b6 feat(agent_utils.py): add FallbackToolExecutionError exception to handle fallback tool execution failures
fix(ciayn_agent.py): improve error message template for tool call errors to provide clearer guidance
refactor(ciayn_agent.py): update comment for clarity regarding fallback tool invocation
fix(output.py): clarify that CiaynAgent handles tool execution errors internally
fix(fallback_handler.py): raise FallbackToolExecutionError for better error handling in fallback scenarios
2025-02-13 16:42:59 -08:00
Ariel Frischer e2cd51c66d feat(agent_utils.py): add SystemMessage import and improve logging messages for clarity
fix(agent_utils.py): handle fallback responses more effectively and ensure fallback handler is optional
refactor(ciayn_agent.py): streamline prompt building and extract tool call logic into a separate method
chore(ciayn_agent.py): remove commented-out code and improve fallback response handling
chore(exceptions.py): remove unused CiaynToolExecutionError class to clean up code
chore(fallback_handler.py): simplify fallback response handling logic
chore(logging_config.py): add debug print statement for logging handler usage
chore(prompts.py): update prompts for clarity and maintainability
2025-02-13 16:14:24 -08:00
Ariel Frischer 646d509c22 feat(agent_utils.py): add agent_type retrieval to enhance fallback handling logic
feat(ciayn_agent.py): implement chat_history in CiaynAgent for improved context management during tool execution
refactor(ciayn_agent.py): streamline fallback response handling and logging for better clarity and maintainability
2025-02-13 00:24:31 -08:00
Ariel Frischer e508e4d1f2 feat(agent_utils.py): introduce get_agent_type function to determine agent type and improve code clarity
refactor(agent_utils.py): update _run_agent_stream to utilize agent type for output printing
fix(ciayn_agent.py): modify _execute_tool to handle BaseMessage and improve error reporting
feat(ciayn_agent.py): add extract_tool_name method to identify tool names from code
chore(agents_alias.py): create agents_alias module to avoid circular imports and define RAgents type
refactor(config.py): remove direct import of CiaynAgent and update RAgents definition
fix(output.py): update print_agent_output to accept agent type for better error handling
fix(exceptions.py): add CiaynToolExecutionError for distinguishing tool execution failures
refactor(fallback_handler.py): improve logging and error handling in fallback mechanism
2025-02-12 17:55:43 -08:00
Ariel Frischer 96b41458a1 feat(agent_utils.py): refactor agent stream handling to improve clarity and maintainability by introducing reset_agent_completion_flags function
feat(fallback_handler.py): enhance fallback handling by allowing RAgents type and improving error handling
fix(config.py): update RAgents type definition to include both CompiledGraph and CiaynAgent for better type safety
refactor(fallback_handler.py): streamline fallback model invocation and response handling for improved readability and functionality
2025-02-12 15:35:31 -08:00
Ariel Frischer 6e8b0f2e42 chore(output.py): remove debug print statements for cleaner code and improved readability 2025-02-12 13:50:37 -08:00
Ariel Frischer 803acc6166 feat(agent_utils.py): convert fallback response to string for prompt concatenation to ensure proper formatting
refactor(fallback_handler.py): change failed_messages from set to list for ordered message handling
refactor(fallback_handler.py): update handle_failure method to accept ToolExecutionError type for better type safety
refactor(fallback_handler.py): implement _reset_on_new_failure method to encapsulate failure reset logic
feat(fallback_handler.py): add construct_prompt_msg_list method to create structured message list for fallback tool calls
2025-02-12 13:39:25 -08:00
Ariel Frischer af9f95ceb1 refactor(agent_utils.py): remove the _handle_tool_execution_error function and simplify error handling in run_agent_with_retry
feat(fallback_handler.py): enhance handle_failure method to extract tool name from ToolExecutionError and improve fallback logic
fix(exceptions.py): update ToolExecutionError to include base_message for better error context
feat(output.py): add base_message to ToolExecutionError for improved debugging
chore(tool_configs.py): update get_all_tools function to specify return type
style(logging_config.py): reorder imports for consistency
test(tests): add tests for new error handling and fallback logic in agent_utils and fallback_handler
2025-02-12 13:07:12 -08:00
Ariel Frischer a7322eaef2 refactor(fallback_handler.py): clean up code by removing unused imports and comments to enhance readability
refactor(fallback_handler.py): extract tool call extraction logic into a separate method for better organization and maintainability
refactor(fallback_handler.py): introduce _parse_tool_arguments method to handle argument parsing, improving code clarity and reusability
2025-02-11 18:38:52 -08:00
Ariel Frischer 67ecf72a6c feat(fallback): implement fallback handler for tool execution errors to enhance error resilience and user experience
refactor(fallback): streamline fallback model selection and invocation process for improved maintainability
fix(config): reduce maximum tool failures from 3 to 2 to tighten error handling thresholds
style(console): improve error message formatting and logging for better clarity and debugging
chore(main): remove redundant fallback tool model handling from main function to simplify configuration management
2025-02-11 18:35:34 -08:00
Ariel Frischer 1388067769 refactor(agent_utils.py): refactor run_agent_with_retry function for better readability and maintainability by extracting helper functions
feat(agent_utils.py): add new helper functions for handling API errors and managing interrupt signals
fix(agent_utils.py): improve error handling in tool execution and retry logic
feat(fallback_handler.py): enhance fallback handling by binding tools correctly during retries
test(tests): add unit tests for new helper functions and refactored logic in agent_utils.py
2025-02-11 12:16:04 -08:00
Ariel Frischer de489584e5 refactor(fallback_handler.py): improve code readability by formatting imports and restructuring for loops
fix(fallback_handler.py): ensure fallback models have a default type of "prompt" and handle exceptions properly during fallback attempts
2025-02-11 01:10:22 -08:00
Ariel Frischer d39be05e39 docs(fallback_handler.py): add detailed docstrings to FallbackHandler methods to improve code documentation and clarity on functionality 2025-02-11 00:44:39 -08:00
Ariel Frischer 3d622911a6 feat(fallback_handler.py): add console notification for tool fallback activation to improve user feedback during failures 2025-02-11 00:40:02 -08:00
Ariel Frischer 0521b3ff9a feat(config.py): add RETRY_FALLBACK_COUNT and RETRY_FALLBACK_DELAY
to configure retry behavior for fallback models

refactor(fallback_handler.py): enhance fallback handling logic to
support both prompt-based and function-calling fallbacks with retries

fix(fallback_handler.py): update fallback model selection to return
dictionaries for better structure and access to model properties
2025-02-11 00:38:15 -08:00
Ariel Frischer 55abf6e5dd feat(fallback_handler): implement FallbackHandler class to manage tool failures and fallback logic
refactor(ciayn_agent): integrate FallbackHandler into CiaynAgent for improved failure handling
fix(agent_utils): add missing newline for better readability in run_agent_with_retry function
test(fallback_handler): add unit tests for FallbackHandler to ensure correct failure handling and fallback logic
2025-02-10 23:37:15 -08:00
Ariel Frischer d8ee4e04f4 feat(fallback): implement automatic fallback to alternative LLM models on consecutive failures to enhance user experience and prevent infinite error loops
refactor(ciayn_agent): restructure tool failure handling to track consecutive failures and fallback attempts more effectively
fix(logging): add pretty logging option for improved log readability
chore(config): define valid providers for LLM selection and update fallback model loading logic
test(ciayn_agent): add unit tests for fallback logic and tool failure handling to ensure reliability and correctness
2025-02-10 14:13:19 -08:00
Ariel Frischer 45b993cfd0 feat(issue): add LLM Tool Call Fallback Feature documentation to outline the new functionality for automatic fallback to alternative LLM models after consecutive failures
feat(ciayn_agent): implement fallback mechanism in CiaynAgent to handle tool call failures and switch to alternative models
feat(__main__): add command line arguments for fallback configuration in the main application
feat(llm): add validation for required environment variables for LLM providers and merge chat histories during fallback
fix(config): define default values for maximum tool failures in configuration
test(ciayn_agent): add unit tests for fallback logic and tool call execution with retries and error handling
test(llm): enhance tests for LLM initialization and environment variable validation
2025-02-09 22:07:23 -08:00
Jose M Leon 00a455d586
FIX do not default to o1 model (#82) 2025-02-08 20:28:10 -05:00
AI Christianson 0c86900ce4 Reduce tool count to make tool calling more reliable. 2025-02-08 18:26:08 -05:00
AI Christianson 13016278e5 prompt improvements 2025-02-08 16:10:24 -05:00
AI Christianson 4c0c2e2ccf prompt improvements 2025-02-08 15:54:18 -05:00
AI Christianson f40e11ee21 improve work logging; use reasoning_effort=high for openai expert models; improve prompts 2025-02-08 14:36:08 -05:00
AI Christianson 5fad3fc755 make cwd/current date available to more agents 2025-02-08 13:58:16 -05:00
AI Christianson ea992960c1 prompt improvements 2025-02-08 13:36:30 -05:00
AI Christianson 2e31bb4ba9 upgrade langgraph deps 2025-02-08 13:34:26 -05:00
AI Christianson c27a75bc26 get rid of pointless truncation message 2025-02-08 12:44:55 -05:00
AI Christianson 5861f3a2bf Adjust token/bytes ratio to resolve errors on swebench-lite. 2025-02-08 08:07:37 -05:00
AI Christianson b673cf61b6 white logo 2025-02-06 19:16:11 -05:00
AI Christianson c59989783d Add python-Levenshtein to deps 2025-02-05 16:17:33 -05:00
AI Christianson 6f865575ee
Update README.md 2025-02-04 15:06:28 -05:00
AI Christianson 04a12b920c README logo 2025-02-04 10:14:48 -05:00
AI Christianson a822ae1332
Update README.md 2025-02-03 15:56:30 -05:00
AI Christianson 0270a9a349 Version bump. 2025-02-02 18:54:27 -05:00
AI Christianson 038f057e59 Fix tests. 2025-02-02 18:53:01 -05:00