fix: resolve all compilation errors and clippy warnings

This commit fixes 12 categories of errors across the codebase:

- Fix owlen-mcp-llm-server build target conflict by renaming lib.rs to main.rs
- Resolve ambiguous glob re-exports in owlen-core by using explicit exports
- Add Default derive to MockMcpClient and MockProvider test utilities
- Remove unused imports from owlen-core test files
- Fix needless borrows in test file arguments
- Improve Config initialization style in mode_tool_filter tests
- Make AgentExecutor::parse_response public for testing
- Remove non-existent max_tool_calls field from AgentConfig usage
- Fix AgentExecutor::new calls to use correct 3-argument signature
- Fix AgentResult field access in agent tests
- Use Debug formatting instead of Display for AgentResult
- Remove unnecessary default() calls on unit structs

All changes ensure the project compiles cleanly with:
- cargo check --all-targets ✓
- cargo clippy --all-targets -- -D warnings ✓
- cargo test --no-run ✓

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-11 00:49:32 +02:00
parent 5c37df1b22
commit 40c44470e8
10 changed files with 55 additions and 65 deletions

View File

@@ -235,7 +235,7 @@ impl AgentExecutor {
}
/// Parse LLM response into structured format
fn parse_response(&self, text: &str) -> Result<LlmResponse> {
pub fn parse_response(&self, text: &str) -> Result<LlmResponse> {
let lines: Vec<&str> = text.lines().collect();
let mut thought = String::new();
let mut action = String::new();
@@ -370,8 +370,8 @@ mod tests {
#[test]
fn test_parse_tool_call() {
let executor = AgentExecutor {
llm_client: Arc::new(MockProvider::new()),
tool_client: Arc::new(MockMcpClient::new()),
llm_client: Arc::new(MockProvider),
tool_client: Arc::new(MockMcpClient),
config: AgentConfig::default(),
};
@@ -399,8 +399,8 @@ ACTION_INPUT: {"query": "Rust programming language"}
#[test]
fn test_parse_final_answer() {
let executor = AgentExecutor {
llm_client: Arc::new(MockProvider::new()),
tool_client: Arc::new(MockMcpClient::new()),
llm_client: Arc::new(MockProvider),
tool_client: Arc::new(MockMcpClient),
config: AgentConfig::default(),
};