feat(v1.0): remove legacy MCP mode and complete Phase 10 migration
This commit completes the Phase 10 migration to MCP-only architecture by removing all legacy mode code paths and configuration options. **Breaking Changes:** - Removed `McpMode` enum from configuration system - Removed `mode` setting from `[mcp]` config section - MCP architecture is now always enabled (no option to disable) **Code Changes:** - Simplified `McpSettings` struct (now a placeholder for future options) - Updated `McpClientFactory` to remove legacy mode branching - Always use MCP architecture with automatic fallback to local client - Added test infrastructure: `MockProvider` and `MockMcpClient` in test_utils **Documentation:** - Created comprehensive v0.x → v1.0 migration guide - Added CHANGELOG_v1.0.md with detailed technical changes - Documented common issues (cloud model 404s, timeouts, API key setup) - Included rollback procedures and troubleshooting steps **Testing:** - All 29 tests passing - Fixed agent tests to use new mock implementations - Updated factory test to reflect new behavior This completes the 10-phase migration plan documented in .agents/new_phases.md, establishing Owlen as a production-ready MCP-only TUI application. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -174,3 +174,54 @@ impl Default for ProviderRegistry {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub mod test_utils {
|
||||
use super::*;
|
||||
use crate::types::{ChatRequest, ChatResponse, Message, ModelInfo, Role};
|
||||
|
||||
/// Mock provider for testing
|
||||
pub struct MockProvider;
|
||||
|
||||
impl MockProvider {
|
||||
pub fn new() -> Self {
|
||||
Self
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl Provider for MockProvider {
|
||||
fn name(&self) -> &str {
|
||||
"mock"
|
||||
}
|
||||
|
||||
async fn list_models(&self) -> Result<Vec<ModelInfo>> {
|
||||
Ok(vec![ModelInfo {
|
||||
id: "mock-model".to_string(),
|
||||
provider: "mock".to_string(),
|
||||
name: "mock-model".to_string(),
|
||||
description: None,
|
||||
context_window: None,
|
||||
capabilities: vec![],
|
||||
supports_tools: false,
|
||||
}])
|
||||
}
|
||||
|
||||
async fn chat(&self, _request: ChatRequest) -> Result<ChatResponse> {
|
||||
Ok(ChatResponse {
|
||||
message: Message::new(Role::Assistant, "Mock response".to_string()),
|
||||
usage: None,
|
||||
is_streaming: false,
|
||||
is_final: true,
|
||||
})
|
||||
}
|
||||
|
||||
async fn chat_stream(&self, _request: ChatRequest) -> Result<ChatStream> {
|
||||
unimplemented!("MockProvider does not support streaming")
|
||||
}
|
||||
|
||||
async fn health_check(&self) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user