Conversation
…gurable working_directory Bug: These tools defaulted to os.getcwd() at call time, causing them to search the agent's repo instead of the target project when the process cwd was set to the agent directory. BashTool didn't have this issue because it already used the BaseTool class pattern with injected working_directory. Changes: - Convert glob_tool, grep_tool, list_tool from @tool functions to BaseTool subclasses - Add create_glob_tool(), create_grep_tool(), create_list_tool() factories - Store working_directory as instance attribute; use as default when path omitted - Update analyzer.py to construct tools with working_directory=project_path
Bug: The planner node emitted the title event but failed to persist it to state when branching to analyzer (Branch 1) or human interaction (Branch 2). On subsequent executions, Branch 3 would unconditionally overwrite the title field, potentially causing duplicate emissions or title changes during replans. Fix: Track when title is newly generated with a flag and conditionally include it in state updates only for that execution. This ensures the title is emitted once, persisted immediately, and never overwritten in subsequent planner calls.
Problem:
Agent was coupled to environment variables for LLM config, preventing
per-request model selection and requiring server restart for changes.
Custom models only worked with OpenAI provider.
Solution:
- Replace env-based config with per-request LLMConfig schema
- Route all providers through LiteLLM (openai, anthropic, gemini, groq, openai_compatible)
- Add shared get_llm_from_config() helper in llm/helpers.py
- Update nodes to accept RunnableConfig and extract llm_config
- Remove langchain-{groq,google-genai,openai}, add langchain-litellm
…ring via pathspec Bug: grep/glob/list tools had inconsistent hardcoded skip directories (e.g., .pytest-cache hyphen vs .pytest_cache underscore in list). Glob had no skip logic at all, walking into .git and .pytest-tmp unnecessarily. Fix: shared _ignore.py module using pathspec.GitIgnoreSpec to honor .gitignore semantics. Only .git is hardcoded because git never lists itself.
Make LLM failures self-heal and visible instead of crashing opaquely: two-layer retry (silent LiteLLM num_retries + visible LangChain .with_retry), error classification into actionable categories, and a new "llm.error" event. Also guard I/O boundaries (writer disk failures, glob/grep errors) and catch GraphRecursionError as a "stuck in loop" event. Fixes two runtime import bugs and adds unit tests for the new code.
…acity policy. - Replace LangChain's `.with_retry()` with a custom `_ResilientRunnable` wrapper using Tenacity `@retry`. - Centralize shared Layer-2 tenacity configuration in `retry_policy()`, which handles retryable exceptions, exponential backoff/jitter, and emitting transient `llm.error` events. - Apply the centralized `retry_policy` to wrap the ReAct loop in the analyzer subgraph (`run_analyzer`), ensuring standard retries and notifications cover the entire agent invocation. - Introduce `tests/integration/helpers.py` to unify LLM config resolution and provider key extraction. - Refactor planner, generator, analyzer, and stream router integration tests to use the new unified helper, eliminating duplicated boilerplate. - Update unit tests in `test_resilience.py` to assert Tenacity retry execution paths, event hooks, and fatal error propagation.
…rialization warnings.
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.
This PR introduces significant architectural improvements to the agent's tool infrastructure and LLM configuration system, enhancing flexibility, correctness, and maintainability.
Changes:
Migrate to per-request LLM configuration via LiteLLM
config.pyLLM configurationllm/factory.pywith dynamic model instantiation per requestllm/helpers.pywith utility functions for LLM operationsFeatures:
Replace hardcoded skip-lists with .gitignore-based filtering
ignore_filter.pymodule usingpathspeclibrary for .gitignore parsing.gitignorepatterns automatically.gitdirectories regardless of .gitignore settingsConfigurable working directory for file tools
BaseToolclassesworking_directoryparameter for flexible path scopingBug Fixes:
Prevent duplicate title emissions in planner
**Classify mutating git subcommands correctly
add,commit,pushas modify operationsTesting:
Dependencies:
pathspecdependency for .gitignore pattern matching (pyproject.toml)