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:
@@ -98,6 +98,17 @@ pub fn draw_chat(frame: &mut Frame, area: Rect, state: &crate::app::state::rest:
|
||||
display_lines.push(Line::from(Span::raw("")));
|
||||
}
|
||||
|
||||
if state.turn_in_flight() {
|
||||
let last_is_user = messages.last().map(|m| matches!(m.role, crate::dto::chat::message::Role::User)).unwrap_or(false);
|
||||
if last_is_user {
|
||||
display_lines.push(Line::from(vec![
|
||||
Span::styled(" AI ", Style::default().fg(Theme::BG).bg(Theme::ROLE_ASSISTANT).add_modifier(Modifier::BOLD)),
|
||||
Span::styled(" Thinking...", Style::default().fg(Theme::DIM)),
|
||||
]));
|
||||
display_lines.push(Line::from(Span::raw("")));
|
||||
}
|
||||
}
|
||||
|
||||
if messages.len() > scroll_offset + max_visible {
|
||||
let below = messages.len().saturating_sub(scroll_offset + max_visible);
|
||||
display_lines.push(Line::from(Span::styled(
|
||||
|
||||
+1
-1
@@ -201,7 +201,7 @@ fn render_overlay(frame: &mut Frame, area: Rect, overlay: crate::app::state::typ
|
||||
Style::default().fg(Theme::DIM),
|
||||
)),
|
||||
Line::from(Span::styled(
|
||||
" OpenRouter - Multi-model API gateway",
|
||||
" Zen API - opencode.ai free model",
|
||||
Style::default().fg(Theme::TEXT),
|
||||
)),
|
||||
Line::from(Span::styled(
|
||||
|
||||
+6
-1
@@ -30,8 +30,13 @@ pub fn draw_status_bar(frame: &mut Frame, area: Rect, state: &crate::app::state:
|
||||
.add_modifier(Modifier::BOLD),
|
||||
);
|
||||
|
||||
let agent_status = if state.turn_in_flight() {
|
||||
"PROCESSING"
|
||||
} else {
|
||||
"READY"
|
||||
};
|
||||
let center_text = Span::styled(
|
||||
format!(" | STATUS: {} | AGENT LOOP: LIVE ", mode_indicator),
|
||||
format!(" | STATUS: {} | AGENT: {} ", mode_indicator, agent_status),
|
||||
Style::default().fg(mode_color),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user