Refactor API integration and enhance command handling

- Removed unused modules and updated module paths for clarity.
- Added autocomplete functionality for command input in InputState.
- Updated AppStateRest to include a method for checking if a turn is in flight.
- Refactored subagent engine to use new API client structure.
- Changed default provider from "openrouter" to "zen" with updated API keys and models.
- Implemented tests for memory management and edit log functionalities.
- Enhanced error handling in API requests and improved response parsing.
- Updated UI components to reflect new API provider and status indicators.
This commit is contained in:
asepharyana
2026-07-11 22:10:17 +07:00
parent f6389018f5
commit 3dee2a1427
30 changed files with 788 additions and 222 deletions
+3 -3
View File
@@ -29,10 +29,10 @@ pub fn run_subagent(ctx: SubagentContext, tx: mpsc::Sender<SubagentEvent>) -> an
let max_steps = ctx.max_steps.min(MAX_AGENT_STEPS);
for step in 0..max_steps {
let api_key = std::env::var("OPENROUTER_API_KEY").unwrap_or_default();
let model = std::env::var("OPENROUTER_MODEL").unwrap_or_else(|_| "anthropic/claude-sonnet-5".to_string());
let api_key = std::env::var("API_KEY").unwrap_or_default();
let model = std::env::var("MODEL").unwrap_or_default();
let client = crate::service::openrouter::OpenRouterClient::new(api_key, model);
let client = crate::service::provider::LlmClient::new(api_key, model);
let response = match client.chat(&messages) {
Ok(r) => r,
Err(e) => {